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.
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.getDescription - This function is used to show and set the description on constituted items.
getDisplayName - This function is used to show and set the display name on constituted items.
getParentItemId - This function is used to show and set the parent item ID on constituted items.
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.0salesDescription = 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};}