Campaign Category
The campaign category record helps you refine the campaign category for a marketing campaign.
For help working with this record in the UI, see Campaign Categories.
The internal ID for this record is campaigncategory.
This record contains the following subrecords:
-
leadsource
-
parent
For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.
Supported Script Types
The campaign category record is scriptable in both client and server SuiteScript.
Supported Functions
The campaign category record supports the following functions: create, read, update, and delete. The following functions aren't supported: copy, search, and transform.
Prerequisites
You must enable the Customer Relationship Management and Marketing Automation features before you can use this record with SuiteScript. For more information, see Marketing Automation Overview.
Code Samples
The following samples show common actions with campaign category scripting.
Create script example:
var record = nlapiCreateRecord('campaigncategory', true);
record.setFieldValue('description', 'Test description');
record.setFieldValue('name', 'Test name');
record.setFieldValue('inactive', 'F');
record.setFieldValue('leadsource', '-6');
record.setFieldValue('parent', '-4');
var recordId = nlapiSubmitRecord(record);
Update script example:
record = nlapiLoadRecord('campaigncategory', recordId);
record.setFieldValue('description', 'Test description updated');
record.setFieldValue('name', 'Test name updated');
record.setFieldValue('inactive', 'T');
record.setFieldText('leadsource', 'Ad');
record.setFieldText('parent', 'Broadcast');
recordId = nlapiSubmitRecord(record);
Delete script example:
nlapiDeleteRecord('campaigncategory', recordId);