web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics 365 returns "Request message has unresolved parameters" when calling an action

(0) ShareShare
ReportReport
Posted on by 401

Hello,

I m getting the following error while calling an action in Dynamics 365 9.0 version

Request message has unresolved parameters

0572.123.PNG

Here is the code.

var parameters = {
"entityRecordId" : "4232901b-2fc5-e711-a898-0022480173bb",
"entityLogicalName" : "opportunity"
};

var req = new XMLHttpRequest();
req.open("POST", "https://org.crm.dynamics.com/.../Microsoft.Dynamics.CRM.new_OpportunityUpdate", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
} else {
var errorText = this.responseText;
}
}
};
req.send(JSON.stringify(parameters));

*This post is locked for comments

I have the same question (0)
  • Michel van den Brink Profile Picture
    4,697 on at

    Hello,

    It looks like you are using a custom defined Action. 

    Can you please post the definition of the Action?

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    Hi Nitin,

    You can use below code,

    function CallAction()

    {

    debugger;

    var leadids = Xrm.Page.data.entity.getId();

    leadids = leadids.replace(/[{}]/g, "");

    var requestData ={

    "Topic" : {"leadid" : leadids, "@data.type":"Microsoft.Dynamics.CRM.lead"}

    };

    var requestMethod = 'POST';

    var actionnew = "leadid("+leadids+")/Microsoft.Dynamics.CRM.str_globalactionnew";

    var req = new XMLHttpRequest();

    req.open(requestMethod, Xrm.Page.context.getClientUrl() + '/api/data/v9.0/' + actionnew, true);

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.setRequestHeader("OData-MaxVersion", "4.0");

    req.setRequestHeader("OData-Version", "4.0");

    req.onreadystatechange = function () {

    debugger;

       if (this.readyState == 4) {

           req.onreadystatechange = null;

           if (this.status == 200) {

               alert("Action called successfully");

           } else {

               var error = JSON.parse(this.response).error;

               alert(error.message);

           }

       }

    };

    req.send(JSON.stringify(requestData));

    }

    If you find it helpful, Please Mark as Verified.

    Best Regards,

    Shahbaaz

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    Topic is the input parameter which i have define in my action, you can change the name accordingly

  • LaszloPenzes Profile Picture
    on at

    Hi,

    I have the same problem. Making changes to a custom action usually breaks it by causing two kinds of issues:

    • The action temporarily responds with 204 No Content instead of the JSON with output parameters. It is probably some caching issue since after waiting for a few hours it works properly. Quite embarrassing when the project deadline is getting closer.
    • Execution fails with the message above, so Request message has unresolved parameters

    Based on the call stack (CrmODataRoutingConvention.SelectAction is the topmost method call) the system can't pick the action to execute. I get the same message if I just type any random action name.

    I'm testing my actions using RESTED Firefox extension, so the problem is for sure not caused by improper JS or wrong action name. Today I made an action, tested, worked ok. Changed it to be a template, created another action based on it and made a minor change (the value of a param of a step) => Request message has unresolved parameters.

    I've been facing the same error many times when I'm deploying custom actions to production environment. Works fine in dev env but fails in prod. Deleting and recreating the exact same action in production usually solves the problem.

    I have to say that custom action could be a very powerful feature if it wasn't so buggy...

    BR,
    Laszlo

  • luoyong Profile Picture
    on at

    Yes, you can say that again.

    We've encountered such problems sometimes.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans