Anyone know how to replicate the behavior of this ...
# suitescript
n
Anyone know how to replicate the behavior of this Work Order link via script? • I can create a Work Order with all the details, but cannot set the "Created From" to the parent WO.
The link is this - /app/accounting/transactions/workord.nl?soid=154455&soline=45&specord=T&entity=2053&assemblyitem=14818&quantity=1&location=4
m
I have no experience with work orders but have you tried passing those URL parameters as defaultValues to
record.create()
n
Interesting idea. I tried created from as a default, but not those. I'll give it a try
sadly no šŸ˜ž
d
The one thing I would add is that the
specord
(or with POs,
dropship
) parameter needs to be a boolean, not a string (
true
, not
"T"
) SO -> WO isn't a "supported" transformation, but neither is SO -> PO (dropship or special order) and we can do that
n
Untitled
Hm. I've tried the above with and without the other variables as string and specord as a boolean. I'll continue to fiddle though and see if this works out
I may have joy, it remains to be seen. The extra difficulty is we have BOMs with thousands of items, so the iteration cycle is long. Also why we have this weird requirement for creating work orders.
Success! I pared it down a bit - record.create({ .... defaultValues: { soid: {enterYourParentWorkOrderId}, soline: '{enterItemLineIndex + 2}', specord: true }
Thanks @David B for the insight