I'm trying to find out if this is a quote or a sales order from within a script.
I've been trying to use the following - but it doesn't reliably work... Some times it won't enter the if statement but other times it works fine. Is a better/different way that works 100% of the time??
var _stateMode = mywindow.modeState();
if(_stateMode == 3){
}