If you want to call plugin from ribbon button click event with custom action, you can use this script. // Ribbon button click event call custom action executeCloneEvent: function (formContext, eventId) { var eventId = formContext.data.entity.getId(); var entityrecordId = eventId.substr(1, eventId.length - 2); var request = { entity: { entityType: "account", id: entityrecordId}, getMetadata: function () { return { boundParameter: "entity", parameterTypes: { "entity": { "typeName": "account", "structuralProperty": 5 }, }, operationType: 0, operationName: "acct_CloneEvent" }; } }; // Calling Plugin Xrm.WebApi.online.execute(request).then(function (result) { ...
Work smarter, not harder.