The statecode controls the state of the Opportunity.
statecode | label |
---|---|
0 | Open |
1 | Won |
2 | Lost |
And the code I used
var statecode = TryParseInt(Xrm.Page.getAttribute('statecode').getValue(), null); if (statecode != null) { // Open if (statecode == 0) { // Do Something } // statecode 1 = Won else if (statecode == 1) { // Do Something } // statecode 2 = Lost else if (statecode == 2) { // Do Something } else { // Handle issue } }
No comments:
Post a Comment