How can I have a client script trigger only when a...
# suitescript
p
How can I have a client script trigger only when a sales order is being created from an estimate?
d
Check the value of the createdfrom field - if it's not empty, the order is being created from another transaction. If you have both estimates and opportunities enabled, you would then need to run a search to determine what type of transaction the order is being created from, but if only estimates are enabled the non-empty value is all the indication you need 🙂
You should probably do this in the pageInit function (especially if you need to run the search to determine the createdfrom transaction type) and store a flag as a global variable.