When creating a workorder from a single line of a ...
# suitescript
s
When creating a workorder from a single line of a sales order, how does a UE on the work order know which line from the sales order was involved?
b
not on the workorder itself, you can load the sales order and match lines, or use the query or search modules which link the workorder to one of the sales order lines
s
thanks @battk I do see an undocumented
soline
field on the WO. Not sure how loading the SO to match lines would work, if the SO can have the same item on multiple lines. With query/search are you suggesting there's a native join to SO line?
b
each sale order line will only be linked to one work order, and the one that has your work order is the matching line
similarly, both the query and search modules represent the relationship between the work order and the sales order at the line level, each line of the sales order will be related to a work order
s
This is a UE script running upon creation of the WO - not sure if that link has been created yet but these are good ideas to try.
b
i doubt you have before submit as an option, work orders created from a sales order only trigger after submit