में जावास्क्रिप्ट से वर्कफ़्लो निष्पादित करें मैं एक रिबन बटन के माध्यम से दृश्य में चयनित रिकॉर्ड्स के लिए वर्कफ़्लो निष्पादित करने का प्रयास कर रहा हूं।सीआरएम 2011
function invokeWorkflow(workflowId, entityId) {
var request =
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
' xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
GenerateAuthenticationHeader() +
' <soap:Body>' +
' <Execute xmlns="http://schemas.microsoft.com/crm/2007/WebServices">' +
' <Request xsi:type="ExecuteWorkflowRequest">' +
' <EntityId>' + entityId + '</EntityId>' +
' <WorkflowId>' + workflowId + '</WorkflowId>' +
' </Request>' +
' </Execute>' +
' </soap:Body>' +
'</soap:Envelope>';
var xhr = new XMLHttpRequest();
xhr.open('POST', '/MSCRMservices/2007/crmservice.asmx', false);
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('SOAPAction', 'http://schemas.microsoft.com/crm/2007/WebServices/Execute');
xhr.send(request);
}
हालांकि, मैं भविष्य रिलीज के लिए यह रख-रखाव CRM 2011 के सेवाओं का उपयोग को बढ़ाने के लिए लिखना चाहते हैं: मैं एक काम कर उदाहरण सीआरएम 4 संगतता के लिए 'विरासत' सेवाओं का उपयोग कर सकते है। यहां तक कि मैंने अभी तक कोशिश की है, लेकिन यह काम नहीं करता है - कॉल का रिटर्न कोड HTTP 500 (आंतरिक सर्वर त्रुटि) है।
function invokeWorkflow(workflowId, entityId) {
var request =
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
' xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
' <soap:Body>' +
' <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">' +
' <Request xsi:type="ExecuteWorkflowRequest">' +
' <EntityId>' + entityId + '</EntityId>' +
' <WorkflowId>' + workflowId + '</WorkflowId>' +
' </Request>' +
' </Execute>' +
' </soap:Body>' +
'</soap:Envelope>';
var xhr = new XMLHttpRequest();
xhr.open('POST', '/XRMServices/2011/Organization.svc/web', true);
xhr.setRequestHeader('Accept', 'application/xml, text/xml, */*');
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('SOAPAction', 'http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute');
xhr.onreadystatechange = function() { alert(xhr.status); };
xhr.send(request);
}
क्या किसी को पता है कि दूसरी स्क्रिप्ट के साथ क्या गलत है? मैंने इसे जितना संभव हो उतना गुगलिंग करने का प्रयास किया है, लेकिन हर उदाहरण में मुझे लगता है कि सीआरएम 2011 के लिए कौन सा दावा होना चाहिए वास्तव में केवल सीआरएम 4 संगतता सेवाओं का उपयोग करना (जैसा कि पहले उदाहरण में है)। मैंने सीआरएम 2011 एसडीके में नमूने से दूसरा उदाहरण स्थापित किया है, हालांकि इसमें ExecuteWorkflowRequest ऑब्जेक्ट का उदाहरण शामिल नहीं है, इसलिए यह केवल सर्वोत्तम अनुमान है।
धन्यवाद!