Site Category

The site category record helps you refine the site category for a website.

For more information about working with site categories in the UI, see Creating Site Categories.

The internal ID for this record is sitecategory.

This record contains the following subrecords:

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

Supported Script Types

The site category record is scriptable in both client and server SuiteScript.

Supported Functions

The site category record is fully scriptable - it can be created, updated, copied, deleted, and searched using SuiteScript. The transform function isn't supported.

Prerequisites

You must enable the Site Builder (Web Store) and Site Builder (Website) features before you can use this record with SuiteScript.

To use all the fields on this record, you must enable the following features: Advanced Site Customization, Multiple Web Sites, Upsell Manager, URL Component Aliases, Multi-Language, Create bundles with SuiteBundler, File Cabinet, SuiteCloud Development Framework, Document Publishing, and Multi-Location Inventory.

Additional Details

  • The tag_subs_machine sublist isn't scriptable with SuiteScript.

  • The following fields of the audience sublist aren't scriptable with SuiteScript: audvendor, audslctrole, audslctextrole, audpartner, audgroup, audemployee, auddepartment, audcustomer, allvendors, allroles, allpartners, allemployees, allcustomers, _eml_nkey_.

  • The ctype field is read-only.

  • For the string fields: description and storeDetailedDescription, the string value must be enclosed in HTML paragraph tags (<p>). For example:

    • description: <p>description</p>

    • storeDetailedDescription: <p>store detailed description</p>

  • For the presentationItem sublist, the item and itemtype fields should be set to the following fixed values:

    • item is set to the item ID

    • itemtype is set to INVTITEM

Code Samples

The following samples show common actions with site category scripting.

Create script example:

              var record = nlapiCreateRecord('sitecategory', true);
record.setFieldValue('itemid', 'Test record');
record.setFieldValue('parentcategory', '-113');
record.setFieldValue('website', '1');
record.setFieldValue('description', ' '<p>description</p>');
record.setFieldValue('detaileddescription', '<p>detailed description</p>');
record.setFieldText('categorylistlayout', 'Basic : Modern Arrows Products (item layout) ');
record.setFieldText('correlateditemslistlayout', 'Basic : Modern Arrows Products (related item layout) ');
…
record.selectNewLineItem('presentationitem');
record.setCurrentLineItemValue('presentationitem', 'item', '100');
record.setCurrentLineItemValue('presentationitem', 'itemtype', 'INVTITEM');
record.commitLineItem('presentationitem');
…
var recordId = nlapiSubmitRecord(record); 

            

Update script example:

              record = nlapiLoadRecord('sitecategory', recordId);
record.setFieldValue('website', '2');
…
record.removeLineItem('presentationitem', 1);
record.selectNewLineItem('presentationitem');
record.setCurrentLineItemValue('presentationitem', 'item', '100');
record.setCurrentLineItemValue('presentationitem', 'itemtype', 'INVTITEM');
record.commitLineItem('presentationitem');
…
recordId = nlapiSubmitRecord(record); 

            

Delete script example:

              nlapiDeleteRecord('sitecategory', recordId); 

            

General Notices