Subscription

The subscription record is used to build recurring subscriptions.

The subscription record is available only when the SuiteBilling feature is enabled at Setup > Company > Enable Features on the Transactions subtab. When the feature is enabled, you can access the subscription record in the UI by going to Transactions > Subscriptions > Create Subscriptions.

The internal ID for this record is subscription.

See the SuiteScript Records Browser for all internal IDs associated with this record. For inforsmation 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 help topics:

Supported Script Types

The subscription record is scriptable in server and client SuiteScript.

Supported Functions

The subscription record is fully scriptable — it can be created, updated, copied, deleted, and searched using SuiteScript.

Code Samples

The following sample shows how to use this record to build a recurring subscription in SuiteScript 2.0.

          require(['N/record'],
function(record) {
var obj = record.create({ type: record.Type.SUBSCRIPTION, isDynamic: true});
obj.setValue('customer', 5);
obj.setValue('startdate', new Date('12/4/2020'));
obj.setValue('subscriptionplan', 21);
obj.setValue('advancerenewalperiodnumber', 10);
obj.setValue('initialterm', -102);
obj.setValue('enddate', new Date('12/10/2021'));
obj.setValue('defaultrenewalterm', 2);
obj.setValue('defaultrenewalplan', 8);
obj.save();
}); 

        

Related Topics

General Notices