Using Infoplus Scripts, create a Warehouse Document script which allows the manipulation of Fulfillment Pick Work documents. Use a Warehouse Document script to add custom messages to work tickets.


NOTE: Once a Warehouse Document script has been created for a specific document type, it will be applied to all work documents for that document type.  For example, if you have a Fulfillment Pick script, that script will apply to every Fulfillment Pick work ticket created since the script has been created.  At this time the only way to disable a Fulfillment Pick script is to delete the script. 


A script of this type has the following variables available:


utils - object with the following methods:

   .log(message) - add a line to the Script Output's log.


infoplusApi - object which provides access to the Infoplus API, specifically, with the following methods:

   .search(type, filter, pageNo, limit, orderBy) - run a search query in the Infoplus API.

   .getById(type, id) - get the record of the specified type identified by the id.

   .getTags(type, id) - get the tags from Infoplus for the specified record.

   .constructModel(type) - used to construct an API model object of the given type.

       - See the https://developer.infopluscommerce.com/ for more details.



If Fulfillment Pick is chosen as the document type, the following variables are available:


work - object which provides access to the Work Infoplus API Model for the pick. 

   .userDefinedMessage() - the message which you want to apply tot he work ticket


item - object which provides access to the corresponding item for the given work

   - See the item section of https://developer.infopluscommerce.com/ for more details.


Here's an example Warehouse Document script.  In this example, the script is getting the item's category and sub category, then adding that information to the corresponding Fulfillment Pick work ticket. 


utils.log("Running Warehouse Document Script...");
 
var majorGroup = infoplusApi.getById("itemCategory", item.majorGroupId);
var subGroup = infoplusApi.getById("ItemSubCategory", item.subGroupId);
 
utils.log("Updating user defined message on work record: " + work.id);
work.userDefinedMessage = majorGroup.name + " - " + subGroup.name;
infoplusApi.update("work", record);
 
// log all orders tied to this work ticket
utils.log("Logging Orders (" + orderList.size() + " total)");
 
for(var i=0; i<orderList.size(); i++)
{
   utils.log("- " + orderList.get(i).orderNo + "\n");
}