Lead Source
The lead source record helps you refine the lead source for a marketing campaign.
For help working with this record in the UI, see Lead Sources.
The internal ID for this record is leadsource.
For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.
Supported Script Types
The lead source record is scriptable in both client and server SuiteScript.
Supported Functions
The lead source 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 lead source scripting.
Create script example:
var record = nlapiCreateRecord('leadsource', true);
record.setFieldValue('description', 'Test description');
record.setFieldValue('name', 'Test name');
record.setFieldValue('inactive', 'F');
var recordId = nlapiSubmitRecord(record);
Update script example:
record = nlapiLoadRecord('leadsource', recordId);
record.setFieldValue('description', 'Test description updated');
record.setFieldValue('name', 'Test name updated');
record.setFieldValue('inactive', 'T');
recordId = nlapiSubmitRecord(record);
Delete script example:
nlapiDeleteRecord('leadsource', recordId);