xTuple.com xTupleU Blog & News Customer Support

How do I know if a salesOrder or Quote in a script?

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){

}

It looks like what you want is modeType instead of modeState. 1 is quote and 2 is order