Skip to main content

Notifications

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

  • Verified answer
    Kokulan Profile Picture
    18,054 on at
    RE: Revise Quote Web Api request not working

    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.

  • Suggested answer
    Srikanta Mahapatro Profile Picture
    190 on at
    RE: Revise Quote Web Api request not working

    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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans