Saturday, 15 October 2016

Call workflow from javascript or jQuery in Dynamic CRM

call workflow from javascript or jQuery in dynamic crm


Description:

In this example we explain that how to call workflow from javascript or jQuery in dynamic crm.sometime we have requirement like we have to call the workflow based on some condition or some demand using javascript.how to find workflow from dynamic crm and call it form clientside like javascript and jQuery.

The user have to first find the workflowid,here we use callWorkFlow function for particular record asynchronously.optionally you can also add callback functions which will fire when the workflow has been executed sucessfully or if it fails.

Parameteres is WorkflowId/Guid,RecordID/Guid,Success Callback(function),Error Callback(function),CRM Base URL .
Code:

Process.callWorkflow("2AB52954-3F2F-5B1D-3EC6-F8987451567A",
    Xrm.Page.data.entity.getId(),
    function () {
        alert("Workflow executed successfully");
    },
    function () {
        alert("Error executing workflow");

    });
This entry was posted in :

0 comments:

Post a Comment