Version: eXtendPS-DE 1.2.8 and above
Audience: Administrator, Developer
Overview
When one field's value depends on another field, using the eXtendTech Field Mappings record to set the value may not yield the expected results due to dependencies or sourcing issues.
To handle these cases, as well as other rules, we have provided a SuiteScript functional hook called beforeItemSave()
. By using this hook, you can access the item record before it is saved to handle complex mapping logic and custom sourcing rules.
Configuration
To use the
beforeItemSave()
functional hook:- Find the following file in the NetSuite file cabinet: suite_promo_transformers.js
- Edit the file and add or update the
beforeItemSave()
function to add the necessary logic and field sourcing depending on your use case. An example function is below.
/** * * @param {Object} args * @prop {Object} args.nsItemRecord * @prop {Boolean} args.isParentRecord * @prop {Object} args.sourceNativeRecord */ function beforeItemSave(args) { let nsItemRecord = args.nsItemRecord; // let isParentRecord = args.isParentRecord; // let sourceNativeRecord = args.sourceNativeRecord; }