Skip to main content

How to call a Action(Process) using JavaScript in Dynamics 365

 Hi everyone, In this blog, I am going to demonstrated how to call action and pass input parameters and receive result data.

Xrm.WebApi.online.execute({
    entity: {
        id: "Record_Id",
        entityType: "new_EntitySchimaName"
    },
    getMetadata: function () {
        return {
            boundParameter: "entity",
            parameterTypes: {
                entity: {
                    "typeName": "CRM.ava_contratto",
                    "structuralProperty": 5
                }
            },
            operationType: 0,
            operationName: "new_Contratto_SetConsumiAnnuiAInKG" //this is action
                                                                //logical name


        };
    }
}).then(function (result) {
    var SIVResponse;
    if (typeof (result.json) === "function") {
        result.json().then(function (response) {


        });
    }
    else {
        SIVResponse = JSON.parse(result.body || result.responseText);

    }
}, function (fail) {
    console.log(fail);
});

Comments