Credit Card Charge

The credit card charge record is available only when a credit card account exists in the system.

For help working with this record in the UI, see Creating Accounts.

The internal ID for this record is creditcardcharge.

See the SuiteScript Records Browser for all internal IDs associated with this record.

Note:

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 credit card charge record is scriptable in server SuiteScript only.

Supported Functions

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

Usage Notes

The script user must have the Credit Card permission with Full permission level.

Code Samples

The following sample shows how to create a $30 credit card charge.

          var charge = record.create({
    type: record.Type.CREDIT_CARD_CHARGE,
    isDynamic: true
});
 
charge.setValue({
    fieldId: 'entity',
    value: '4'
});
charge.setValue({
    fieldId: 'account',
    value: '128'  // Account must be created before (Type = Credit Card)
});
charge.setValue({
    fieldId: 'exchangerate',
    value:'1.00'
});
charge.setValue({
    fieldId: 'postingperiod',
    value: '45'
});
charge.setValue({
    fieldId: 'memo',
    value: 'MEMO'
});
charge.setValue({
    fieldId: 'class',
    value: '1'
});
charge.setValue({
    fieldId: 'department',
    value: '1'
});
charge.setValue({
    fieldId: 'location',
    value: '1'
});

charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'account',
    line: 1,
    value: '58'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'amount',
    line: 1,
    value: '30.00'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'memo',
    line: 1,
    value: 'MEMO2'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'class_',
    line: 1,
    value: '1'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'department',
    line: 1,
    value: '1'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'location',
    line: 1,
    value: '1'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'customer',
    line: 1,
    value: '3'
}); 
charge.setSublistValue({
    sublistId: 'expense',
    fieldId: 'isbillable',
    line: 1,
    value: 'F'
}); 
var recordId = charge.save(); 

        

Related Topics

General Notices