Hello,
Please help me on this. Struggling for a long time.
Quote record, Currently it is in draft state, if a specific field is marked as true then activate the record (No default button usage).
So to do that operation, I have written the soap message to activate it and registered this on Save operation.
Now the problem is, before the save operation gets completed the activation of the quote is happening, after that when it continues to the save operation it is failing to save because the record is activated and moved to read only.
Please do not suggest me to do it in the server side because after his activation operation I am again firing another soap message for converting the quote in to order and I should open the created order record which is not possible with the server side code.
For this, I have tried the below code. It is saving the record but it is not continuing to the next operation.
Here is my code:
Tas.Quote = {
activateQuoteRequestOnSaveComplete: function (quoteContext) {
if (!isAlreadySaved) {
isAlreadySaved = true;
quoteContext.getEventArgs().preventDefault();
activateQuote = Xrm.Page.getAttribute("tas_signsowandsend").getValue() &&
Xrm.Page.getAttribute("tas_signsowandsend").getIsDirty();
}
else {
isAlreadySaved = false;
}
//activateQuote = Xrm.Page.getAttribute("tas_signsowandsend").getValue() &&
// Xrm.Page.getAttribute("tas_signsowandsend").getIsDirty();
if (isAlreadySaved)
Xrm.Page.data.save().then(Tas.Quote.activateQuoteRequest,
function (errorCode, message) {
});
},
This is saving the record but not continuing to activate request.
Please suggest on this.