Hi Team,
Can anyone please help me with the following code to close the quote as Won using WinQuote action?
I want to call this function from the ribbon after activating the Quote. At the moment I am getting the error message.
function wonQuote() {
var parameters = {};
var QuoteID = Xrm.Page.data.entity.getId();
var entity = {};
entity.id = "6a769b48-c34e-ea11-a812-000d3ad1c2b4";
entity.entityType = "quote";
//parameters.entity = entity;
parameters.Status = 1;
var getWinQuoteRequest = {
entity: parameters.entity,
Status: parameters.Status,
getMetadata: function () {
return {
boundParameter: "entity",
parameterTypes: {
"entity": {
"typeName": "mscrm.quote",
"structuralProperty": 5
},
"Status": {
"typeName": "Edm.Int32",
"structuralProperty": 2
}
},
operationType: 0,
operationName: "WinQuote"
};
}
};
Xrm.WebApi.online.execute(getWinQuoteRequest).then(
function success(result) {
if (result.ok) {
//Success - No Return Data - Do Something
}
},
function (error) {
Xrm.Utility.alertDialog(error.message);
}
);
}
Thank you heaps team