CMS Content Type

CMS page enables you to create different content types for your website. For more information, see Site Management Tools.

For help working with this record in the UI, see CMS Content.

The internal ID for this record is cmspage.

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 CMS content type record is scriptable in server SuiteScript only.

Supported Functions

The CMS content type 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 Site Management Tools feature on the Web Presence subtab at Setup > Company > Enable Features to be able to script with this record.

Script Samples

The following sample code snippets show how to create and search for CMS content type records. All CMS content type records are associated with a custom record. For more information, see Custom Records and Creating Custom Record Types

Create CMS Content Type Record

The following sample code snippet creates a basic CMS content type record and associates it with the specified custom record.

          var cmsContentTypeRecord = record.create({
    type: record.Type.CMS_CONTENT_TYPE
});
cmsContentTypeRecord.setValue({
    fieldId: 'name',
    value: 'cms content type name'
});
cmsContentTypeRecord.setValue({
    fieldId: 'label',
    value: 'content type label'
});
cmsContentTypeRecord.setValue({
    fieldId: 'description',
    value: 'My cms content type description'
});
cmsContentTypeRecord.setValue({
    fieldId: 'customrecordid',
    value: 123                  // example value
});

var contentTypeID = cmsContentTypeRecord.save(); 

        

Search CMS Content Type Records

The following sample code snippet searches for all CMS content type records for a given SCA site. It returns the name, site, pagetype, and url fields as search result columns.

          function searchCmsContentTypeRecords(){
    var searchColumns = search.create({
        type: search.Type.CMS_CONTENT_TYPE,
        columns: [{
            name: 'name'
        }, {
            name: 'label'
        }, {
            name: 'customrecordid'
        }]
    });
    searchColumns.run().each(function(result){
        var name = result.getValue({
            name: 'name'
        });
        var label = result.getValue({
            name: 'label'
        });
        var customRecordId = result.getValue({
            name: 'customrecordid'
        });
        return true;
    });
} 

        

Related Topics

CMS Content
Working with the SuiteScript Records Browser
SuiteCloud Supported Records
Website
Commerce Category
Website Setup
CMS Page

General Notices