Version: eXtendPS-SE 1.3.6.4 and above
Audience: Administrator, Developer
Overview
The eXtendPS-SE Media Content service does not directly support the DecorationArray and LocationArray objects. This guide explains how to include these objects in the PromoStandards Media Content response using SuiteScript functional mappings.
Prerequisites
You must be using the eXtendPS-SE Media Details custom record provided with the eXtendPS-SE bundle.
Configuration
Follow these steps to include DecorationArray and LocationArray information:
1. Add Custom Fields
Add additional fields on the eXtendPS-SE Media Details custom record to capture DecorationArray and LocationArray details.
2. Configure Search Columns
Add the new fields in the "ADDITIONAL MEDIA RECORD SEARCH COLUMNS" field on the eXtendPS-SE Product Media setup screen.
3. Update SuiteScript Function
Create or modify the
getMediaObjectFromMediaSearch()
function in the suite_promoapi_invoice_transformers.js
file Example Implementation
Here's how to return the LocationArray using a custom field:
- Add the custrecord_extend_imp_location field to the eXtendPS-SE Media Details custom record as a multiple select field sourcing from the "Imprint Location" custom list.
- Add the custrecord_extend_imp_location field to the "ADDITIONAL MEDIA RECORD SEARCH COLUMNS" field in the Product Media setup.
- Create or modify the
getMediaObjectFromMediaSearch()
function in thesuite_promoapi_invoice_transformers.js
file to return the location object as locationArray.
/** * @param {Object} args * @prop {Array} args.mediaContentSearchResults //Total media record search results * @prop {Object} args.mediaContentSearchResult //Current media record search result object */ function getMediaObjectFromMediaSearch(args) { var mediaContentSearchResults = args.mediaContentSearchResults; var mediaContentSearchResult = args.mediaContentSearchResult; var locationArray = []; var locationId = mediaContentSearchResult.getValue({ name: 'custrecord_extend_imp_location' }); //This field will be created in your account var locationName = mediaContentSearchResult.getText({ name: 'custrecord_extend_imp_location' }); //This field will be created in your account locationArray.push({ locationId: locationId, locationName: locationName }); log.debug({ title: 'getMediaLocationObject locationArray', details: locationArray }); return { locationArray: locationArray, // decorationArray: decorationArray }; }