Version: eXtendPS-SE 1.3.6 and above
Audience: Administrator, Developer

Features Available Using Functional Mappings

Functional mappings allow you to configure and map complex data objects that cannot be directly mapped using a single field or hard-coded mapping. To meet these complex mapping needs based on your business requirements, you can utilize NetSuite's SuiteScript capabilities..

Note: All functional mappings must be specified in the file: suite_promoapi_invoice_transformers.js. 

The out-of-the-box functions demonstrate the format in which data can be returned. However, you will need to modify the code according to your specific requirements. The function has access to the current items being returned in the response. If you need to access fields that are not configured in  the PromoStandards Setup screens, you will need to configure them in the Additional Search Columns section under the respective setup screen.

Product Data Service 

Product Packaging & Shipping Array

The ProductPackagingArray and ProductShippingArray features of the Product Data service cannot be directly configured from the Product Data setup screen. However, you can configure them by using functional mappings to send a response.

The function getProductPackagingAndShippingData() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Below are the details regarding the sub-elements and data types of these elements based on PromoStandards:
a. Product Packaging Array
Field
Description
Data Type
Required?
default
Boolean flag identifying the single default packaging for this package
BOOLEAN
TRUE
packageType
The packaging specific type for this partId e.g. Gift Box, Cello Pack, Sleeve
256 STRING
TRUE
description
The Packaging specific description
2048 STRING
FALSE
quantity
The partId unit Quantity included within this specific Packaging Option
DECIMAL
TRUE
dimensionUom
The unit of measure for the package
2 STRING FACIT
TRUE
depth
The depth/length of the package in the dimensionUom unit of measure
DECIMAL
FALSE
height
The height of the package in the dimensionUom unit of measure
DECIMAL
FALSE
width
The width of the package in the dimensionUom unit of measure
DECIMAL
FALSE
weightUom
The weight unit of measure for the packageType
2 STRING FACIT
TRUE
weight
The weight of the specific packageType
DECIMAL
FALSE

b. Product Shipping Array
Field
Description
Data Type
Required?
packageType
The shipping package specific type for this shipping package e.g. Box, Carton, etc.
256 STRING
TRUE
description
The shipping package specific description
2048 STRING
FALSE
quantity
The partId unit quantity included within this specific shipping packaging option
DECIMAL
TRUE
dimensionUom
The weight unit of measure for the packageType
2 STRING FACIT
TRUE
depth
The depth/length of the shipping package in the dimensionUom unit of measure
DECIMAL
FALSE
height
The height of the shipping package in the dimensionUom unit of measure
DECIMAL
FALSE
width
The width of the shipping package in the dimensionUom unit of measure
DECIMAL
FALSE
weightUom
The weight unit of measure for the packageType
2 FACIT STRING
TRUE
weight
The weight of the specific packageType
DECIMAL
FALSE

Product Marketing Data

Product Marketing Points can be specified as a custom record to send in the Product Data response. If you need a custom configuration to return values for marketing points, you can create a functional mapping specifically for this purpose.

The function getProductMarketingData() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Below are the details regarding the sub-elements and data types of these elements based on PromoStandards:
Field
Description
Data Type
Required?
pointType
Basic category or type of marketing point being made.  e.g. Highlights, Size, Safety
64 STRING
FALSE
pointCopy
Marketing bullet or point copy
1024 STRING
TRUE

Product Category Array

By default, the Product Category Object is supported only via NetSuite's native Class field.

If you need a custom configuration to return values for product categories, you can create a functional mapping specifically for this purpose.

The function getProductCategories() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Below are the details regarding the sub-elements and data types of these elements based on PromoStandards:
Field
Description
Data Type
Required?
category
Product category
256 STRING
TRUE
subCategory
Product subcategory
256 STRING
FALSE

Related Product Array

The RelatedProductArray feature of the Product Data service cannot be directly configured from the Product Data setup screen. However, you can configure it by using functional mappings to send a response.

The function getRelatedProducts() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Below are the details regarding the sub-elements and data types of these elements based on PromoStandards:
Field
Description
Data Type
Required?
relationType
The relationship type between two products
64 STRING
TRUE
productId
Product Id
64 STRING
TRUE
partId
Part specific Id.
64 STRING
FALSE

ProductPart Object > ColorArray

In the Product Data response, we have included an item field mapping to display the color from the item record. However, this mapping can only display a single value for the color object.

To display multiple colors from the color array in the product data response, you need to create a functional mapping in the suite_promoapi_invoice_transformers.js file. Name this functional mapping as product_getPartColorArray().
Sample function:
/**
 * 
 * @param {Object} args 
 * @prop  {Object} args.itemSearchResult
 * @prop  {Object} args.itemSearchResults
 * @prop  {Object} args.partItemSearchResult
 * @prop  {Object} args.partItemSearchResults
 * @prop  {Object} args.setupPartColorFieldMap
 */
function product_getPartColorArray(args) {
    return [{
      Color: [{
        standardColorName: 'Blue',
        hex: '#00F',
        approximatePms: '#00249c',
        colorName: 'Blue',
      }]
    }];
  }
Note: This feature is supported in eXtendPS-SE 1.3.8 and above.

ProductPart Object > PrimaryColor

The PrimaryColor feature of the Product Data service cannot be directly configured from the Product Data setup screen. However, you can configure it by using functional mappings to send a response.


The function product_getPartPrimaryColor() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.


Sample function:
/**
 * 
 * @param {Object} args 
 * @prop  {Object} args.partColorArray
 * @prop  {Object} args.itemSearchResult
 * @prop  {Object} args.itemSearchResults
 * @prop  {Object} args.partItemSearchResult
 * @prop  {Object} args.partItemSearchResults
 * @prop  {Object} args.setupPartColorFieldMap
 */
function product_getPartPrimaryColor(args) {
    return [{
      Color: [{
        standardColorName: 'Blue',
        hex: '#00F',
        approximatePms: '#00249c',
        colorName: 'Blue',
      }]
    }];
  }

Media Service 

Media Content Array

Media Details can be specified as a custom record to send in the Media Content response. More details regarding this configuration can be found in eXtendPS-SE User Guide.

If you need a custom configuration for returning values for the Media Content Array, you can create a functional mapping specifically for this purpose.

The function getMediaObject() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Below are the details regarding the sub-elements and data types of these elements based on PromoStandards:

Media Content Object
Field
Description
Data Type
Required?
productId
The associated Product Id
64 STRING
YES
partId
The part Id associated to the product Id.
64 STRING
NO
url
The URL of the media location.  Any valid URL can be returned including prefixes like http and ftp.
1024 STRING
YES
mediaType
The type of media
STRING FACET
YES
ClassTypeArray
An array of ClassType objects that classify of the media
OBJECT ARRAY
YES
fileSize
The file size
DOUBLE
NO
width
Width
INT
NO
height
Height
INT
NO
dpi
Dots per inch
INT
NO
color
The color description
256 STRING
NO
DecorationArray
An array of decoration objects that describe the decorations associated with the media
OBJECT ARRAY
NO
LocationArray
An array of location objects that describe the locations associated with the media
OBJECT ARRAY
NO
description
Information about the media
1024 STRING
NO
singlePart
Identifies whether the partId one to one corresponds with the image.  (Use FALSE for group shots)
BOOLEAN
YES
changeTimeStamp
The date time since last change in UTC
ISO 8601
NO

Class Type Object

Field
Description
Data Type
Required?
classType
The classification of the media
INT
YES
className
The classification short name
64 STRING
YES

Decoration Object

Field
Description
Data Type
Required?
decorationId
The decoration id associated with the media
INT
YES
decorationName
The name of the decoration associated with the id
64 STRING
YES

Location Object

Field
Description
Data Type
Required?
locationId
The location id associated with the media
INT
YES
locationName
The name of the location associated with the id
64 STRING
YES

Order Shipment Notification Service

Ship Methods

Ship Method can be mapped from the Order Shipment Notification Setup screen.

If you require a custom configuration for returning values for the Ship Method, you can create a functional mapping specifically for this purpose.

The function getShipmentMethod() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Note: The data type for this field should be a string (128 String) and it is not a mandatory field.

Order Status Service

Order Status

By default, the order status that is selected on the sales order's eXtendPS-SE Order Status field will be included in the Order Status response..

If you want to customize the configuration for returning the Order Status, you can create a functional mapping specifically for this purpose.

The function getOrderStatus() is available in the suite_promoapi_invoice_transformers.js file. It allows the addition of custom configurations based on the specific requirements.

Note: Only valid PromoStandards Order Status values should be returned. The list of valid order status values are below.
  1. Order Received
  2. Order Entry Hold
  3. Order Confirmed
  4. Pre-Production
  5. General Hold
  6. Credit Hold
  7. Proof Hold
  8. Art Hold
  9. Back Order Hold
  10. In Production
  11. In Storage
  12. Partial Shipment
  13. Complete
  14. Canceled

Product Pricing & Configuration Service

eXtendPS-SE supports certain features exclusively through the use of functional mappings. The following is a list of features that are supported by functional mappings:

Item Price Level Mapping

Mapping between NetSuite price levels and PromoStandards price levels can be specified on the eXtendPS-SE P&C setup screen. This configuration will send the pricing data of the configured price levels in the PromoStandards response for all items.

If you want to include other price level data in the PromoStandards pricing response for specific sets of items or a certain time period, you can use the function getItemPriceLevelMap() provided in the suite_promoapi_invoice_transformers.js file. An example use case would be if you want to send a special price for certain items during a special sale period, you can utilize this feature.

Note: To include custom search columns in the main item search results, follow these steps:

  1. Go to the P&C setup screen.
  2. Under the Additional Configuration section, specify the columns you want to add in the "Additional Item Search Columns" field.
  3. For decoration data, make sure you have a saved search that includes the additional columns you need.
  4. In the Decoration Field Mapping section of the P&C setup, enter the saved search ID in the "SAVED SEARCH ID FOR DECORATION" field.

Filtering Pricing Groups


If you want to include specific pricing groups in the PromoStandards pricing response, you can use the function getContextualPriceSearchResult() provided in the suite_promoapi_invoice_transformers.js file.