Any idea on how to automate Special Order creation...
# suitescript
j
Any idea on how to automate Special Order creation from SO on edit context? Per checking record.Transform it's not supported. TIA!
c
Can't you just create the record, populate the fields, save?
record.transform is just a helper function that does the field population for you, the lack of support for transforming your record doesn't stop you from doing it field by field.
j
It will break the linking between Special PO and SO
b
manually create the purchase order from the ui by clicking the link
pay special attention to the url parameters
those are the default values you need to use while creating the record yourself
j
Thank you! Will check this. 👍
c
@Jars You don't need to break the link between the transactions, surely you can just use a foreign key (save the Special PO ID on the SO record or vice versa?)
j
Thanks, @Craig — we want to retain the original linking on standard "Create PO" column. We were able to achieve by setting "defaultValue" parameter on record.create. This article also helped— https://blog.prolecto.com/2015/12/13/learn-the-suitescript-pattern-to-generate-target-purchase-orders-from-sales-orders/ Thank you @battk!
c
The default value you passed in is basically the foreign key to the PO. Glad you got it working.