Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

call work flow by javascript in CRM 2015 online

(0) ShareShare
ReportReport
Posted on by 1,558

Hello Team,

when i am tring to call workflow by its id.I have get error.I think   Xrm.Page.context.getAuthenticationHeader()

function is no longer exist in crm 2015 online.Please suggest me or correct the code.

Thanks

Code:

function startWorkflow() {
    var xml = "" +
      "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
      "<soap:Envelope xmlns:soap=\"schemas.xmlsoap.org/.../envelope\" xmlns:xsi=\"www.w3.org/.../XMLSchema-instance\" xmlns:xsd=\"www.w3.org/.../XMLSchema\">" +
         Xrm.Page.context.getAuthenticationHeader() +
      "<soap:Body>" +
      "<Execute xmlns=\"schemas.microsoft.com/.../WebServices\">" +
      "<Request xsi:type=\"ExecuteWorkflowRequest\">" +
      "<EntityId>" + Xrm.Page.data.entity.getId() + "</EntityId>" +
      "<WorkflowId>" + '227DB37B-938F-4FE9-829A-D982B371002A' + "</WorkflowId>" +
      "</Request>" +
      "</Execute>" +
      "</soap:Body>" +
      "</soap:Envelope>";
    var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xmlHttpRequest.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute");
    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
    xmlHttpRequest.send(xml);
}

*This post is locked for comments

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,401 on at
    RE: call work flow by javascript in CRM 2015 online

    You can refer this for call process library

    processjs.codeplex.com

  • Suggested answer
    GandeShiva Profile Picture
    GandeShiva 105 on at
    RE: call work flow by javascript in CRM 2015 online

    Thank You So much. It worked fine for me...!

  • RE: call work flow by javascript in CRM 2015 online

    Guido, Nice code - thanks for sharing.

    best wishes,

    harihar

  • Tin Profile Picture
    Tin 1,558 on at
    RE: call work flow by javascript in CRM 2015 online

    nice code....

    thank you very much its working.

  • Tin Profile Picture
    Tin 1,558 on at
    RE: call work flow by javascript in CRM 2015 online

    It gives error.Are you sure this will work in CRM 2015 online?

  • Tin Profile Picture
    Tin 1,558 on at
    RE: call work flow by javascript in CRM 2015 online

    As your reffed link nothing will shown still.Please suggest me what i have to do ?

  • Tin Profile Picture
    Tin 1,558 on at
    RE: call work flow by javascript in CRM 2015 online

    Hello Guido,

    your reffed link is not working,its not having containt.Please check it.

    And,I am not using  Xrm.Page.context.getServerUrl anywhere.i think in my code.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans