I have a workflow task that I want to use to update a field. I want to sum a field in a SalesOrder with all the Invoice nettotals summed up. Therefor I want to get all invoices that are related to the same salesorder that I am launching the workflow task on. So I'm using to do that. Problem is, there are many salesorders that have that exact subject. So the workflow engine gives me all of those and sums up all the invoices that have that text in the 'Related SalesOrder' field. Which is not what I want, I want only the Invoices that have that exact salesorder CRM ID. So basically I'd like to do something like , but that's not working for me.
I worked around this now by adding a task before the update task that fills a custom field in the invoice with the salesorder_no. The second task (the one that sums) then checks against that salesorder_no on other invoices. This works, but I don't like it since it needs an extra field, task and only works correctly when every invoice has been saved once to update the related salesorder_no (to do the filtering).
Code:
$(salesorder_id : (SalesOrder) subject)
Code:
$(salesorder_id : (SalesOrder) salesorderid)
I worked around this now by adding a task before the update task that fills a custom field in the invoice with the salesorder_no. The second task (the one that sums) then checks against that salesorder_no on other invoices. This works, but I don't like it since it needs an extra field, task and only works correctly when every invoice has been saved once to update the related salesorder_no (to do the filtering).