Version: eXtendSanMar 1.0.8 and above
Audience: Administrator

Use Cases


  • Pair legacy items or items constituted outside of the bundle's item search feature with SanMar id to take advantage of integrated PO, fulfillment automated vendor bills creation.
This article will walk you through the configuration and process involved in item linking.

Standard Item Linking Process

  1. Create a saved search against the legacy items you want to link with SanMar - To exclude items that have already been linked, add a Criteria Value for SanMar Item Color Text = Empty or SanMar eXtendTech ID = Empty which will indicate the item hasn't been linked with SanMar (since the linking process would populate that field value).

    Image Placeholder

    In your saved search results specify the Item Color, Item Size , and SanMar Item Style fields to be used for finding the appropriate item on SanMar's item database. These will be the values which will be used when contacting SanMar's API and requesting item information. Example below where the existing items' Style, Color, and Size fields are in the results.
    Image Placeholder
  2. Create a new Script Deployment for the eXtendSanMar Link Items Map Reduce scriptOn the Parameters subtab, enter parameters from your saved search.

    1. Enter the Internal Id for your saved search.
    2. Enter the associated column number for your Formula Field containing the Item Color from your Saved Search.
    3. Enter the associated column number for your Formula Field containing the Item Size from your Saved Search.
    4. Enter the associated column number for your Formula Field containing the Item Style from your Saved Search.
    5. Save and Execute the script deployment for initiating the item linking process.
      Image Placeholder
    6. You can view the status of the script execution by clicking on the “Status Page” link.

      Image Placeholder

Notes:
Catalog Color-based search:
If you want to include the SanMar Catalog Color for matching your NetSuite SanMar items, then you can do so by including your catalog color field in the saved search from step 1 and specifying the search column in the following format under the "Indices Saved Search Column Index" script parameter. If your search column sequence is 9, then you will need to set the value as {"catalogColorIndex":9}.



External ID based search:
If you want to match your legacy NetSuite SanMar items based on the external ID, then you need to include the NetSuite item field which contains the external ID in the saved search from step 1 and you will need to specify it in the "Indices Saved Search Column Index" script parameter. If your search column sequence for the external ID field in your search is 9, then you will need to set the value as {"externalIdIndex":9}.

The Item match will first be performed by matching Color/Size/Style, if provided, and then matched by externalid.
You can also link items using only external ID, in such case clear the mappings specified under step 2,3, & 4. Make sure to have correct external IDs of the items because it will link the item and populate the respective fields even if the item's color and size specified on the item record doesn't match with the color and size present against the specified external ID of the item.


Custom Script-based Item Linking Process

The eXtendSanmar bundle also allows you to provide custom SuiteScript logic for item matching by using custom functions, so that the item matching search filters and search results can be customized further.

The following functions are supported:

1. beforeItemMatchingSearch -  This function allows you to insert custom logic for item matching filter criteria before the native matching search is executed. You will need to specify this function and your filter criteria in the suite_sanmar_transformers.js file.

    /**
     * 
     * @param {Object} args 
     * @prop {Array} args.searchFilters
     * @prop {Array} args.searchColumns
     * @prop {Boolean} args.isParentRecord
     * @prop {Object} args.sourceNativeRecord
     */ 
    function beforeItemMatchingSearch(args){ }

2. afterItemMatchingSearch - This function allows you to insert custom logic for item matching filter criteria after the native matching search is executed. You will need to specify this function and your filter criteria in the suite_sanmar_transformers.js file.

    /**
     * 
     * @param {Object} args 
     * @prop {Array} args.nsItemSearchResults
     * @prop {Boolean} args.isParentRecord
     * @prop {Object} args.sourceNativeRecord
     */ 
    function afterItemMatchingSearch(args){ }