if i do a record.transform in ns, for a transfer o...
# ask-stanley-ai
e
if i do a record.transform in ns, for a transfer order to an item fulfillment - how is it possible to receive an error “name”“INVALID TRANS TYP”,“message”“Transaction type specified is incorrect.” EVEN THOUGH THE ITEM FULFILLMENT GETS GENERATED SUCCESSFULLY?!?
c
AI generated answer (using internal Slack threads):
The error
INVALID_TRANS_TYP
typically occurs when the transaction type specified in the
record.transform
function is incorrect. However, in your case, it seems like the Item Fulfillment is being generated successfully, which is a bit unusual. One possible explanation could be that the script is trying to transform the Transfer Order into an Item Fulfillment more than once. If the Transfer Order has already been partially fulfilled, attempting to transform it again could result in this error. This is because once a Transfer Order is partially fulfilled, it is marked as 'Pending Receipt', and cannot be fulfilled again until the status changes. Here's a snippet from one of the conversations that might be relevant:
Copy code
"<@U03GYQZTZDW> maybe that is it. the script was able to partially fulfill the transfer order. then when we received additional api calls from the warehouse to fulfill the remaining it errored out"
To avoid this, you could add a check in your script to ensure that the Transfer Order is not already 'Pending Receipt' before attempting to transform it. Also, ensure that the script has sufficient permissions to perform the operation. One of the conversations mentioned an error related to insufficient permissions:
Copy code
"You must have  'Transactions -> Fulfill Sales Orders' view permission to view sales order fulfillments."
Lastly, make sure that the
fromType
and
toType
parameters in the
record.transform
function are correct. In your case,
fromType
should be
record.Type.TRANSFER_ORDER
and
toType
should be
record.Type.ITEM_FULFILLMENT
. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.875336707
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.869084179
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856920481
Please provide your feedback on this answer.