I need to match a work order with it's corresponding line in the related Sales Order. My script works fine finding the line using the Item number in a saved search. However, the item number may be more than once in the sales order, so, I need to get to the specific Sales Order line referencing my Work Order. I have tried using field "woid", however, this is not exposed for saved searches or scripts. I have also tried defining a custom field in both, the Sales Order line, and the Work order body, to keep them on sync via workflow, however, that did not work either. Also, I found a reference to using a sentence: "SO.getLineItemValue('item', 'woid',i)", and I 've got an error saying: "org.mozilla.javascript.EcmaError: TypeError: Cannot find function getLineItemValue in object dynamic record." (Yes… I tried with sandard record as well… No luck).
Here is the question. Do you know of any solution for this situation?