User Manual

10.04.2024

MANUAL

Developer Features: Server Script: items.NewSite

## Overview Create a new instance of the "apiModel object" for the "[Site](/en/manual/site)" in the "[Server Script](/en/manual/table-management-server-script)". ## Syntax ``` items.NewSite(referenceType) ``` ## Parameters |Parameter|Type|Required|Description| |:----------|:----------|:---:|:---------------------------| |referenceType|string|Yes|Specify the site type. <br>"Sites": Site<br>"Issues": Time-limited Table<br>"Results": Recorded Table<br>"Wikis": Wiki<br>"DashBoard": Dashboard| ## Return Value Returns the "apiModel object" of the "[Site](/en/manual/site)". ## Usage Example 1 In the example below, a "[Folder](/en/manual/folder)" named "Pleasanter" will be created on the top page (site ID 0). ##### JavaScript ``` let siteId = 0; let item = items.NewSite("Sites"); item.Title = 'Pleasanter'; items.Create(siteId, item); context.Log(item.SiteId); // Output ID of the created site ``` ## Usage Example 2 In the example below, we create a "Time-limited Table" named "Issue Management" on site ID 2. Use items.Create. ##### JavaScript ``` let siteId = 2; let item = items.NewSite("Issues"); item.Title = 'Issue Management'; item.SiteSettings = {}; items.Create(siteId, item); context.Log(item.SiteId); // Output ID of the created site ``` ## Usage Example 3 In the example below, we create a "Recorded Table" named "Customer Management" on site ID 2. Use apiModel.Create. ##### JavaScript ``` let siteId = 2; let apiModel= items.NewSite("Results"); apiModel.Title = 'Customer Management'; apiModel.SiteSettings = {}; apiModel.Create(siteId); context.Log(apiModel.SiteId); // Output ID of the created site ``` ## Related Information <div id="ManualList"><ul><li><a href="/en/manual/site">Site Function</a><span>10.07.2024 up</span></li></ul></article> <ul><li><a href="/en/manual/folder">Folder function</a><span>08.13.2024 up</span></li></ul></article> <ul><li><a href="/en/manual/table-management-server-script">Table Management: Server Script</a><span>08.13.2024 up</span></li></ul></article></div><input id="SearchTextHidden" type="hidden" value="" />
TOP
このページをシェアする
記載された商品名、各製品名は各社の登録商標または商標です。 © Implem Inc.