var statecodeValue = Xrm.Page.getAttribute("statecode").getValue();
//statecodeValue = (2:Lost 0:Open 1:Won)
微软CRM