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.

/**
     * @param {Object} args
     * @prop  {Object} args.osnSetupData
     * @prop  {Array}  args.searchResults
     * @prop  {String} args.itemFulfillmentId
     * @prop  {String} args.fulfillmentSearchResult
     *
     * @param {Object} packageObject
     * @prop  {Object} packageObject.trackingNumber
     * @prop  {Object} packageObject.shipmentDate
     * @prop  {Object} packageObject.carrier
     * @prop  {Object} packageObject.shipmentMethod
     * @prop  {Object} packageObject.shippingAccount
     * @prop  {Object} packageObject.ItemArray
     *
     * @returns {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;
    }