Website Setup
The internal ID for this record is website
. In the UI, you can find this record by going to Commerce > Websites > Website List.
For help working with this record in the UI, see Site Builder Web Site Record Settings.
See the SuiteScript Records Browser for all internal IDs associated with this record.
For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.
For information about scripting with this record in SuiteScript, see the following:
Supported Script Types
The web site setup record is scriptable in server SuiteScript only.
The web site record is not supported in beforeLoad
user event scripts.
Supported Functions
The web site setup record is fully scriptable. It can be created, copied, updated, deleted, and searched using SuiteScript.
Usage Notes
Developers can use SuiteScript with the web site setup record whether they are working in accounts using Site Builder, Commerce web stores, or SCIS.
Creating a Web Site Setup Record in SuiteScript
The following code sample shows how to create a SuiteCommerce Web Site Setup record using SuiteScript 2.0:
/**
* @NApiVersion 2.x
*/
require(['N/record'], function(record) {
var initValues = new Array();
initValues.displayname = "name_of_your_website";
initValues.internalname = "name_of_your_website";
initValues.sitetype = "ADVANCED";
initValues.websitescope = "SUITE_COMMERCE";
var objRec = record.create({
type: record.Type.WEBSITE,
defaultValues: initValues
});
var recId = objRec.save({
enableSourcing: false,
ignoreMandatoryFields: false
});
})
To set up any other kind of website, the same code is applicable but the sitetype
and websitescope
parameters must contain different values. The required values for the different site types are as follows:
Product |
sitetype value |
websitescope value |
---|---|---|
SuiteCommerce |
ADVANCED |
SUITE_COMMERCE |
SuiteCommerce Advanced |
ADVANCED |
SUITE_COMMERCE_ADVANCED |
SuiteCommerce In Store |
ADVANCED |
SUITE_COMMERCE_IN_STORE |
SuiteCommerce My Account |
ADVANCED |
SUITE_COMMERCE_MY_ACCOUNT |
Site Builder |
STANDARD |
One of the following: FULL_WEB_STORE INFO_CATALOG_PRICING INFO_CATALOG INFO_ONLY For more information about these options, see Multi-Site Settings. |
Websitescope field for ADVANCED sites is read-only by default. This means that you cannot modify websitescope for an existing ADVANCED site.
Setting Values for Web Site Setup Dropdown Fields
The following table lists the dropdown fields on the Web Site Setup record. When writing SuiteScript, if you are setting the value of a dropdown field, use the IDs listed in the column called Internal IDs for Dropdown Values.
Tab |
Dropdown Field |
UI Labels for Dropdown Values |
Internal IDs for Dropdown Values |
---|---|---|---|
Setup tab |
|||
|
Note:
Web Site Scope can be changed only for Site Builder sites. |
|
|
|
|
|
|
A |
|||
|
|
|
|
|
|
|
|
|
|
|
|
Upsell tab |
|||
|
|
|
|
|
|
|
|
Legacy tab -applies only to Site Builder |
|||
|
|
|
|
S |
|||
|
|
|
|