Skip to content

Developer Function: Script: $p.apiUpdateSite

Overview

This is a script function that allows you to update site information using Ajax POST requests.

Syntax

JavaScript
$p.apiUpdateSite({
    id: (Site ID to be updated),
    data: {
        (Site information to be updated)
    },
    done: (Optional Processing),
    fail: (Optional Processing),
    always: (Optional Processing)
});

Description Of Each Parameter

Parameter name Description Required
id Site ID to update Yes
data JSON data to POST *See additional information in the margin No
done API communication successful Yes
fail API communication failure No
always On completion No

*The JSON data to be POST must be set to the same value as the "Site" parameter when the site package was exported. After obtaining site information with "$p.apiGetSite", we will assume that the request data will be created by changing the column you want to update.

Usage Example

JavaScript
$p.apiUpdateSite({
  id: 123,
  data: {
    TenantId: 1,
    Title: 'Site name',
    ReferenceType: 'Issues',
    ParentId: 99999,
    InheritPermission: 99999,
    SiteSettings: {
      Version: 1.017,
      ReferenceType: 'Issues',
      GridColumns: [
        'IssueId',
        'TitleBody',
        'Comments',
        'StartTime',
        'CompletionTime',
        'WorkValue',
        'ProgressRate',
        'RemainingWorkValue',
        'Status',
        'Manager',
        'Owner',
        'Updator',
        'UpdatedTime'
      ],
      EditorColumnHash: {
        General: [
          'IssueId',
          'Ver',
          'Title',
          'Body',
          'StartTime',
          'CompletionTime',
          'WorkValue',
          'ProgressRate',
          'RemainingWorkValue',
          'Status',
          'Manager',
          'Owner',
          'Comments'
        ]
      }
    },
    done: function (data) {
      //Optional Processing
    },
    fail: function (data) {
      //Optional Processing
    },
    always: function (data) {
      //Optional Processing
    }
  }
});