Campaign Subscription

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

For help working with this record in the UI, see Setting Up Campaign Subscriptions.

The internal ID for this record is campaignsubscription.

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

Supported Functions

The campaign subscription 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 subscription scripting.

Create script example:

              var record = nlapiCreateRecord('campaignsubscription', true);
record.setFieldValue('description', 'Test description');
record.setFieldValue('externaldescription', 'Test external description');
record.setFieldValue('name', 'Test name');
record.setFieldValue('externalname', 'Test external name');
record.setFieldValue('inactive', 'F');
record.setFieldValue('subscribedbydefault', 'F');
var recordId = nlapiSubmitRecord(record); 

            

Update script example:

              record = nlapiLoadRecord('campaignsubscription', recordId);
record.setFieldValue('description', 'Test description updated');
record.setFieldValue('externaldescription', 'Test external description updated');
record.setFieldValue('name', 'Test name updated');
record.setFieldValue('externalname', 'Test external name updated');
record.setFieldValue('inactive', 'T');
record.setFieldValue('subscribedbydefault', 'T');
recordId = nlapiSubmitRecord(record); 

            

Delete script example:

              nlapiDeleteRecord('campaignsubscription', recordId); 

            

Related Topics

General Notices