Version: eXtendPS-DE 1.3.1 and above
Audience: Administrator, Developer

Overview

eXtendPS-DE supports PromoStandards' Product Data 2.0.0 endpoints. You can use your vendor's PromoStandards Product Data 2.0.0 endpoints to view item details using the item search screen and create items.

Since the data structure in Product Data 2.0.0 is different from Product Data 1.0.0, you will need to update your transformers file if you want to create items using PromoStandards 2.0.0 endpoints.

If you only want to view the items using the item search screen, the only configuration required is to set up the new endpoint on the associated vendor record. For instructions on configuring your NetSuite Vendor with PromoStandards Services Endpoints, refer to this documentation.

The following is a list of functions in eXtendPS-DE's suite_promo_transformers.js file that require updates. If these functions are not already present in your account, they will need to be created in the suite_promo_transformers.js file.

  1. getDescription - This function is used to show and set the description on constituted items.

  2. getDisplayName - This function is used to show and set the display name on constituted items.

  3. getParentItemId - This function is used to show and set the parent item ID on constituted items.

  4. setSublistVendorCode - This function is used to set the vendor, vendor code, and purchase price under fields in the vendor sublist on constituted items.

Updated Function Snippets

getDescription

/**
 * @param {Object} args
 * @property {Object} args.sourceNativeRecord
 */
function getDescription(args) {
  var salesDescription = (args.sourceNativeRecord.description ? (args.sourceNativeRecord.description) : '');

  if (salesDescription && Array.isArray(salesDescription) && (salesDescription.length > 0)) {
    // This section executes for product data 2.0
    salesDescription = salesDescription.join(', ');
  }

  if (salesDescription.length > 4000) {
    salesDescription = salesDescription.substring(0, 4000);
  }
  return  { value : salesDescription };
}

getDisplayName

/**
 * @param {Object} args 
 * @property {Object} args.sourceNativeRecord
 */
function getDisplayName(args){
    var sourceNativeRecord = args.sourceNativeRecord;
    var productName = (sourceNativeRecord.productName || sourceNativeRecord.productname || '');
    var displayName = productName + ((!productName && sourceNativeRecord.productPart && sourceNativeRecord.productPart.productColor) ? (sourceNativeRecord.productPart.productColor || '') :
    ((productName && sourceNativeRecord.productPart && sourceNativeRecord.productPart.productColor) ?  ('-' + sourceNativeRecord.productPart.productColor) : '')) +
    (sourceNativeRecord.productPart && sourceNativeRecord.productPart.apparelSize && sourceNativeRecord.productPart.apparelSize.apparelSize ? ('-' + sourceNativeRecord.productPart.apparelSize.apparelSize) : '');
    displayName = displayName.replace(/�/g, '');
  
    return { value: displayName.substring(0, 60) };
  }

getParentItemId

/**
 * @param    {Object} args
 * @property {Object} args
 */
function getParentItemId(args){
    var sourceNativeRecord = args.sourceNativeRecord;
    var vendorName = getVendorNameFromVendorId(sourceNativeRecord) || '';
    var itemId = ( (sourceNativeRecord && (sourceNativeRecord.productId || sourceNativeRecord.productid)) ? (sourceNativeRecord.productId || sourceNativeRecord.productid) : '');
  
    return { value: itemId.substring(0, 60) };
  }

setSublistVendorCode

/**
 * @param {Object} args
 * @prop  {Object} args.sourceNativeRecord
 * @desc // set vendor code in item vendor sublist
 *       // If this function is not added then sourceNativeRecord.external_id will be set by default
 */
function setSublistVendorCode (args) {
    var vendorCode = '';
    if(args.sourceNativeRecord && args.sourceNativeRecord.productPart && args.sourceNativeRecord.productPart.partid) {
      vendorCode = args.sourceNativeRecord.productPart.partid;
    } else if (args.sourceNativeRecord && args.sourceNativeRecord.productId) {
      vendorCode = args.sourceNativeRecord.productId;
    } else if (args.sourceNativeRecord && args.sourceNativeRecord.productid) {
      vendorCode = args.sourceNativeRecord.productid;
    }
    return  { value : vendorCode};
  }

Note: If there are any other functional mappings created in your account that are used in item constitution, please contact eXtendTech Support to update those functions to make them compatible with Product Data 2.0.0.