I'm trying to transform a transfer order into item...
# suitescript
s
I'm trying to transform a transfer order into item fulfillment and this is the error we got this morning
Copy code
You have an invalid sales order 9499153 or the order is already closed.
also an error we are getting why is it bringing up anything about sales order
Copy code
You must have  'Transactions -> Fulfill Sales Orders' view permission to view sales order fulfillments.
code
Copy code
var ifRec = record.transform({
        fromType: record.Type.TRANSFER_ORDER,
        fromId: rec.id,
        toType: record.Type.ITEM_FULFILLMENT,
        defaultValues: {},
      });
s
I think 'sales order' is a typo - (i.e. netsuite probably has that hardcoded in the error message, no matter what transaction types are actually involved)
s
which error
s
the one that says 'sales order ### is closed' - may not be a sales order.
sounds like this code is executing with insufficient permissions - did you address your second error?
s
yes
so the first error is when i try to delete the transfer order so i see the error out put is a typo ,
how can i make sure that the script wont run after submit on delete ?
s
check the context and have the script not do anything if it's a delete operation?
s
ok thanks for the help
the second error seems odd
in addition when calling record.transform how can I make sure it is only for the items that arent filled yet like the UI fulfill button
s
if you do a transform I think it will only include lines that aren't fulfilled yet. That should be automagic.
👍 1