
Hi,
I have created custom button and on click of that JavaScript custom action is executed which has one "Entity Reference" as output parameter.
which calls the plugin and I have set the value of output parameter in Plugin.(Value is set in Output parameter i checked this while debugging the code.)
But I am not getting output parameter values in JavaScript code.
Below is my JavaScript code:
var target = {};
target.entityType = "cf_budgettracker";
target.id = Id;
var request = {};
request.entity = target;
request.getMetadata = function () {
return {
boundParameter: "entity",
parameterTypes: {
"entity": {
typeName: "mscrm.cf_budgettracker",
structuralProperty: 5
}
},
operationType: 0, // This is an action.
operationName: "cf_CloneBudgetAction"
};
};
Xrm.WebApi.online.execute(request).then(
function (result) {
if (result.ok) {
//output values are not coming
}
},
function (error) {
console.log(error.message);
// handle error conditions
}
);
}
};
Plugin Registration Details:
Action:
*This post is locked for comments
I have the same question (0)It has been almost a year since you asked this question but I had the same question and thought I would add an answer in case others came to this post.
According to carldesouza.com/.../ there are different code paths when using different methods so you should use XMLHttpRequest instead of Xrm.WebApi.