Commerce Category

Commerce Categories enable you to create a hierarchical structure of product categories, subcategories, and products.

For help working with this record in the UI, see Commerce Categories.

In the UI, you can go to Commerce > Content Management > Catalog & Categories > Commerce Categories to access this record.

The internal ID for this record is commercecategory.

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

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 commerce category record is scriptable in server SuiteScript only.

Supported Functions

The commerce category record is partially scriptable. It can be created, updated, and searched using SuiteScript. It cannot be copied, attached, or transformed.

Usage Notes

You must enable the Commerce Category feature on the Web Presence subtab at Setup > Company > Enable Features to be able to script with this record. The 2020.2 release introduces a new sublist that includes the customersegment and customersegmentsize fields. Note that you cannot create, edit, or delete commerce category sublists through SuiteScript.

Script Sample

The following sample code snippet searches for a commerce category record with a fullurl of “/cat-0” and siteid of 2. It returns fullurl, addtohead, and subcataddtoheadoverride as search result columns.

          var fullurl = '/cat-0';
var siteid = 2;

var mySearch = search.create({
    type: search.Type.COMMERCE_CATEGORY,
    filters: [{
        name: 'fullurl',
        operator: search.Operator.IS,
        values: fullurl
    }],
    columns: [{
        name: 'fullurl'
    }, {
        name: 'addtohead'
    }, {
        name: 'subcataddtoheadoverride'
    }]
});
mySearch.run().each(function(result){
    var name = result.getValue({
        name: 'fullurl'
    });
    var site = result.getValue({
        name: 'addtohead'
    });
    var pageType = result.getValue({
        name: 'subcataddtoheadoverride'
    });
    return true;
}); 

        

Related Topics

Commerce Categories
Working with the SuiteScript Records Browser
SuiteCloud Supported Records
Website
Website Setup
Shopping Cart
CMS Content
CMS Content Type
CMS Page

General Notices