Charge

The charge record is used to represent a single billable amount that a client must pay.

The charge record is available only when the Charge-Based Billing feature is enabled at Setup > Company > Enable Features, on the Transactions subtab. When the feature is enabled, you can access the charge record in the UI by choosing Transactions > Customers > Create Charges > List.

For help working with this record in the UI, see Generating Charges.

The internal ID for this record is charge.

See the SuiteScript Records Browser for all internal IDs associated with this record. For information 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 charge record is scriptable in server SuiteScript only.

All three user events are supported: beforeLoad, beforeSubmit, and afterSubmit.

Supported Functions

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

Code Samples

The following sample shows how to create a charge record.

          var charge = record.create({
    type: record.Type.CHARGE
});
charge.setText({
    fieldId: 'stage',
    text: 'Ready'
});
charge.setValue({
    fieldId: 'chargeType',
    value: 'Time'
});
charge.setValue({
    fieldId: 'billto',
    value: '43'
});
charge.setValue({
    fieldId: 'chargedate',
    value: '6/10/2012'
});
charge.setValue({
    fieldId: 'salesorder',
    value: '122'
});
charge.setValue({
    fieldId: 'salesorderonline',
    value: '1'
});
charge.setValue({
    fieldId: 'currency',
    value: '1'
});
charge.setValue({
    fieldId: 'billingitem',
    value: '21'
});
charge.setValue({
    fieldId: 'timerecord',
    value: '2'
});
charge.setValue({
    fieldId: 'description',
    value: 'Charge description'
});
charge.setValue({
    fieldId: 'rate',
    value: '2'
});
charge.setValue({
    fieldId: 'quantity',
    value: '3'
});
charge.setValue({
    fieldId: 'amount',
    value: '5'
});
var recordId = charge.save(); 

        

Related Topics

General Notices