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)

Revise Quote Web Api request not working

(0) ShareShare
ReportReport
Posted on by 25

Hi, I'm trying to Revise Quote through Web Api request but I'm always getting error like this,

ReviseQuoteError.png

When I search for error code it is mentioned as Invalid Argument

<crmerror>
<ErrorId>80040203</ErrorId>
<ManagedErrorName>InvalidArgument</ManagedErrorName>
<ErrorMessage>Invalid argument.</ErrorMessage>
<UnManagedErrorName>IDS_INVALIDARG</UnManagedErrorName>
</crmerror>

My code:

var parameters = {};
parameters.QuoteId = "CBE9F1D4-C91F-E911-A81F-000D3A31270E";

var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/ReviseQuote", 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 === 200) {
var results = JSON.parse(this.response);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(parameters));

I don't know what I'm missing here. Can anyone please help me out ?

Regards,

Praveen

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Srikanta Mahapatro Profile Picture
    190 on at

    Hi,

    Instead of sending the parameters in request.send() send the GUID in the URL itself.

    var req = new XMLHttpRequest();
    req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/ReviseQuote(CBE9F1D4-C91F-E911-A81F-000D3A31270E)", 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 === 200) {
    var results = JSON.parse(this.response);
    } else {
    Xrm.Utility.alertDialog(this.statusText);
    }
    }
    };
    req.send();

    Thanks,
    Srikanta

    If found useful, please mark the answer as verified

  • Verified answer
    Kokulan Profile Picture
    18,054 on at

    Could you try including the ColumnSet in your parameters as the system first tries to do a Close Quote and it might be failing because of missing ColumnSet parameter.

    var parameters = {};

    parameters.QuoteId = "CBE9F1D4-C91F-E911-A81F-000D3A31270E";

    parameters.ColumnSet = {AllColumns: true, Columns: []};

    Hope this helps.

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