Price Rule Entry

Use a price rule entry to set automatic price adjustments. For example, you could set up a price reduction that comes into effect when the customer orders a specified item quantity.

The record ID for a price rule entry record is priceruleentry. This record contains one subrecord, with record ID quantityBreaks.

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 purchase price rule entry record is scriptable in server and client SuiteScript.

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

Supported Functions

The purchase price rule entry record is partially scriptable. It can be read, created, updated, copied, and deleted using SuiteScript. Search and transform scripting is not supported.

Prerequisites

You must enable Advanced Pricing before you can use this record through SuiteScript.

Usage Notes

The following fields on this record can't be updated by SuiteScript, because the fields are set by the system:

  • item

  • pricelist

You can't edit or create a price rule entry record that references a currently inactive price rule.

Code Sample

The following sample shows how to create a new price rule.

            require(['N/record'], function(record) {
    var rec = record.create({
        type: "priceruleentry",
        isDynamic: true
    });
    rec.setValue({
        fieldId: "pricerule",
   value: 1
    });
    rec.setValue({
        fieldId: "item",
   value: 34
    });
    rec.insertLine({
        sublistId: "quantitybreaks",
        line: 0
    });
    rec.setCurrentSublistValue({
        sublistId: "quantitybreaks",
        fieldId: "rate",
        value: 10.99
    });
    rec.commitLine({sublistId:"quantitybreaks"});
    log.debug(rec.save());
}); 

          

General Notices