This question is related to Dynamics CRM 365 cloud version 9.
I created a custom action namely wfrv_GetOpportunity and I wanted to execute this custom action using java script in a ribbon button command.
I created a request variable which contains the custom action name and its metadata.
Then i used web api call to execute the custom action like following.
Xrm.WebApi.online.execute(request).then(
function (result) {
if (result.ok) {
result.json().then(function (response) {
if (response.OpportunityModel) {
opportunityModelReceived = JSON.parse(response.OpportunityModel);
}
});
}
},
function (error) {
consol.log(error.message);
}
);
Everything worked fine till i used classic CRM pages.
When i migrated to UCI CRM page, the above web api call was giving error.
When i debugged found out that web api call received a error message BAD REQUEST with error code 400. I did not modify anything in the request object.
So Web api execute method for executing custom action is working fine when i use classic crm page but not working when i use UCI crm page.
Any suggestion to solve this problem will be highly appreciated.
Thanks,
Bibhu