Hi there experts.
I have changed salesorder entity and create a new status reason in Submitted.
I have added a status reason named PreTransport in submitted state, with value 100000004.
I can go from Active state(pending status reason) to Submitted state(In-Progress) via this call web service :
var request = "" request += "<s:Envelope xmlns:s=\"schemas.xmlsoap.org/.../envelope\">"; request += " <s:Body>"; request += " <Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">"; request += " <request i:type=\"b:SetStateRequest\" xmlns:a=\"schemas.microsoft.com/.../Contracts\" xmlns:b=\"schemas.microsoft.com/.../Contracts\">"; request += " <a:Parameters xmlns:c=\"schemas.datacontract.org/.../System.Collections.Generic\">"; request += " <a:KeyValuePairOfstringanyType>"; request += " <c:key>EntityMoniker</c:key>"; request += " <c:value i:type=\"a:EntityReference\">"; request += " <a:Id>" +recordGuid+ "</a:Id>"; request += " <a:LogicalName>salesorder</a:LogicalName>"; request += " <a:Name i:nil=\"true\" />"; request += " </c:value>"; request += " </a:KeyValuePairOfstringanyType>"; request += " <a:KeyValuePairOfstringanyType>"; request += " <c:key>State</c:key>"; request += " <c:value i:type=\"a:OptionSetValue\">"; request += " <a:Value>"+stateCode+"</a:Value>"; request += " </c:value>"; request += " </a:KeyValuePairOfstringanyType>"; request += " <a:KeyValuePairOfstringanyType>"; request += " <c:key>Status</c:key>"; request += " <c:value i:type=\"a:OptionSetValue\">"; request += " <a:Value>"+statusCode+"</a:Value>"; request += " </c:value>"; request += " </a:KeyValuePairOfstringanyType>"; request += " </a:Parameters>"; request += " <a:RequestId i:nil=\"true\" />"; request += " <a:RequestName>SetState</a:RequestName>"; request += " </request>"; request += " </Execute>"; request += " </s:Body>"; request += "</s:Envelope>"; //send set state request var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/Organization.svc/web", true) // Responses will return XML. It isn't possible to return JSON. req.setRequestHeader("Accept", "application/xml, text/xml, */*"); req.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); req.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute"); var successCallback = null; var errorCallback = null; req.send(request );
But It does not work from In-Progress to PreTransport that are in the same state.
I suppose that it because of permission.
Should I set Permission on this new status reason?
If yes How can I do this?
Note that I have CRM 2011 on-premise .
*This post is locked for comments