Version: eXtendPS-SE 1.3.6.7 and above
Audience: Administrator, Developer
Overview
Using eXtendPS-SE, you can send custom values for length, width, height, and weight in the Order Shipment Notification's PackageArray response using custom SuiteScript functions.
To achieve this, utilize the getPackageMethod() function, which supports returning custom length, width, height, and weight values in the PackageArray.
Configuration
To add this function, modify the suite_promoapi_invoice_transformers.js file. If multiple files with this name exist in your account, select the one in the eXtendTech folder.
Below are details regarding the function's attributes.
/** * @service Order Shipment Notification (OSN 1.0.0) * @desc Customizes individual Package objects (tracking details, shipping carrier, account). * * @param {Object} args * @prop {Object} args.osnSetupData - Active OSN setup configuration record * @prop {Array} args.searchResults - Full array of search results * @prop {String} args.itemFulfillmentId - Item Fulfillment internal ID * @prop {Object} args.fulfillmentSearchResult - Current Item Fulfillment SearchResult * * @param {Object} packageObject - Default constructed package tracking object * @prop {String} packageObject.trackingNumber - Tracking number string * @prop {String} packageObject.shipmentDate - ISO date string of shipment * @prop {String} packageObject.carrier - Shipping carrier description * @prop {String} packageObject.shipmentMethod - Shipping service level method * @prop {String} packageObject.shippingAccount - Shipper account number * @prop {Object} packageObject.ItemArray * * @returns {Object} Modified Package object * { * id: 'value', * trackingNumber: 'value', * shipmentDate: 'value', * dimUOM: 'value', * length: 'value', * width: 'value', * height: 'value', * weightUOM: 'value', * weight: 'value', * carrier: 'value', * shipmentMethod: 'value', * shipmentTerms: 'value', * ItemArray: 'value' * }; */ function getPackageMethod(args, packageObject) { var osnSetupData = args.osnSetupData; var searchResults = args.searchResults; var itemFulfillmentId = args.itemFulfillmentId; var fulfillmentSearchResult = args.fulfillmentSearchResult; //Please do not change the below order of json keys, it may not validate in validator tool. // var toReturnPackageObject = {}; // toReturnPackageObject['id'] = packageObject.id || undefined; // toReturnPackageObject['trackingNumber'] = packageObject.trackingNumber || undefined; // NOTE if specified will override the value that came through the setup screen mapping // toReturnPackageObject['shipmentDate'] = packageObject.shipmentDate || undefined; // NOTE if specified will override the value that came through the setup screen mapping // toReturnPackageObject['dimUOM'] = 'Inches' || undefined; // toReturnPackageObject['length'] = '10' || undefined; // toReturnPackageObject['width'] = '10' || undefined; // toReturnPackageObject['height'] = '10' || undefined; // toReturnPackageObject['weightUOM'] = 'Pounds' || undefined; // toReturnPackageObject['weight'] = '10' || undefined; // toReturnPackageObject['carrier'] = packageObject.carrier || undefined; // NOTE: if specified it will override the one in Setup screen mappings // toReturnPackageObject['shipmentMethod'] = packageObject.shipmentMethod || undefined; // NOTE: if specified it will override the one in Setup screen mappings // toReturnPackageObject['shipmentTerms'] = packageObject.shipmentTerms || undefined; // toReturnPackageObject['ItemArray'] = packageObject.ItemArray || undefined; // You can override the object. Make sure you do NOT violate the structure, as it will cause distributor applications to fail // return toReturnPackageObject; }