Campaign Audience

The campaign audience record helps you refine the campaign audience for a marketing campaign.

For help working with this record in the UI, see Campaign Audiences.

The internal ID for this record is campaignaudience.

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 campaign audience record is scriptable in both client and server SuiteScript.

Supported Functions

The campaign audience 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 Marketing Automation feature 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 audience scripting.

Create script example:

              var record = nlapiCreateRecord('campaignaudience', true);
record.setFieldValue('description', 'Test description');
record.setFieldValue('name', 'Test name');
record.setFieldValue('inactive', 'F');
var recordId = nlapiSubmitRecord(record); 

            

Update script example:

              record = nlapiLoadRecord('campaignaudience', recordId);
record.setFieldValue('description', 'Test description updated');
record.setFieldValue('name', 'Test name updated');
record.setFieldValue('inactive', 'T');
recordId = nlapiSubmitRecord(record); 

            

Delete script example:

              nlapiDeleteRecord('campaignaudience', recordId); 

            

Related Topics

General Notices