Update Worknotes on purchase

Aaron Brown2
Tera Expert

Good day everyone.

 

I am having some trouble accomplishing a task that I think will help our team.   Like anyone, we order products and some of those products are consumable.  Without getting super in the weeds with how we do things, understand that we continuously order consumables based on a project need so even if we have 200 of something in stock, they are "allocated" for a certain project.  I am trying to update the work notes of the merged record (after receipt) of the consumable to show qty ordered and project name/number.  We have a separate project table that we built to hold the project information.  How do I update worknotes on a consumable item after a purchase order line item that is consumable has been received?

 

I am currently using a flow;

AaronBrown2_0-1698339468086.png

The flow execution report says it ran successfully and it is pulling the correct information into the worknote, however its not updating the consumable with the worknote.  Can anyone assist?

1 REPLY 1

Aaron Brown2
Tera Expert

Script portion for updating the worknotes field:

var quantity = fd_data.trigger.current.ordered_quantity
var externalPO = fd_data.trigger.current.purchase_order.x_g_16af_ssc_external_po
var projectName = fd_data.trigger.current.purchase_order.x_g_16af_ssc_project.project_name

var workNote = "Quantity " + quantity + " ordered on Purchase Order " + externalPO + " for project " + projectName
return workNote