ANS-1565 · SALES ORDER PROCESSING

How to Determine if a Sales Order’s Payment Method is a Credit Card

Leverage a custom transaction body field to efficiently identify credit card payment methods on sales orders without consuming SuiteScript metering units.

Short answer

To identify if a Sales Order's payment method is a credit card, create a custom transaction body checkbox field. Configure it to source from the Payment Method list, specifically from 'Credit Card'. This field will automatically populate, allowing scripts to easily check its value using currentRecord.getValue() without incurring SuiteScript metering charges.

Scenario

Users often need to programmatically determine if a Sales Order's payment method is a credit card for various business logic or reporting purposes. Directly querying payment method details can sometimes be complex or consume SuiteScript metering units. A streamlined, efficient method is required to identify credit card transactions.

Solution

To determine if a Sales Order's payment method is a credit card, implement the following steps:

  1. Create a custom transaction body field.

  2. Configure the field with these properties:

    • Type: Checkbox
    • Store Value: False
    • Display Type: Disabled/Inline Text/Hidden
    • Source List: Payment Method
    • Source From: Credit Card

    Once configured, the value of this custom field can be accessed programmatically using SuiteScript 2.0/2.1. For example, to retrieve the value of a custom field with ID custbody_xxx, use:

javascript
currentRecord.getValue('custbody_xxx');

This approach provides an efficient way to identify credit card payment methods without utilizing SuiteScript metering units.

Expert NetSuite Support

Need help with this NetSuite issue?

Sales Order Processing consulting and configuration support

Talk to a consultant