Billing Rate Card Record Macros

The billing rate card record type currently supports the modifyPricebyPercent macro.

For help working with this record in the UI, see Using Billing Rate Cards.

For information about SuiteScript 2.x record macros, see the following help topics:

modifyPriceByPercent

Corresponding UI Button

Recalculate

Macro Description

Modifies the price list on the record by a specified percentage.

Returns

{notifications:[], response:{}}

Supported Script Types

Client and server scripts

For additional information, see SuiteScript 2.x Script Types.

Since

2018.1

Parameters

See Record.executeMacro(options) for details about parameters required for the execution of any macro. The modifyPriceByPercent macro also requires the following additional parameter.

Parameter

Type

Required / Optional

Description

Since

percent

number

required

The percentage amount by which the price list is modified. May be positive or negative.

2018.1

Billing Rate Card modifyPriceByPercent Macro Syntax

The following code sample is from a Suitelet that increases the prices on a billing rate card with id 1 by 10%.

            /**
 * @NApiVersion 2.x
 * @NScriptName Script Parameter Test
 * @NScriptType suitelet
 */
define(['N/record'], function(record) {
    return Object.freeze({
        onRequest : function(context) {
            var rec = record.load({
                type: 'billingratecard',
                id: 1,
                isDynamic: true
            });
            rec.executeMacro({
                id: 'modifyPriceByPercent',
                params: { percent: 10 }
            });
            rec.save();
        }
    });
}); 

          

Related Topics

Using Billing Rate Cards
Billing and Invoices
Using Billing Classes
Working with the SuiteScript Records Browser
SuiteScript Supported Records
Lists

General Notices