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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Error code: 0x83215603 Please wait while saving is completed

(0) ShareShare
ReportReport
Posted on by

I am getting popup that "Please wait while saving is completed". Here is my code. I am calling initializing function onload and saving by js.

_opportunityOnLoad_EnableDisableField: function (executionContext) {

var formContext = executionContext.getFormContext();
formContext.data.entity.addOnSave(RBSCRM.Opportunity.FormEvents._opportunityOnSave_DuplicateLendingJourneyWI);
formContext.data.process.addOnPreStageChange(RBSCRM.Opportunity.FormEvents._opportunityOnSave_DuplicateLendingJourneyWI);


var formType = formContext.ui.getFormType();
if (formType != 1) {
//if (formContext.getAttribute("header_rbscrm_opportunityteamcaptain") == null) {
// formContext.getControl("header_rbscrm_opportunityteamcaptain").setDisabled(false);
//} else {
// formContext.getControl("header_rbscrm_opportunityteamcaptain").setDisabled(true);
//}
if (formContext.getAttribute("rbscrm_confidentialitystatus").getValue() == null) {
formContext.getControl("rbscrm_confidentialitystatus").setDisabled(false);
} else {
formContext.getControl("rbscrm_confidentialitystatus").setDisabled(true);
}
}
},

_opportunityOnSave_DuplicateLendingJourneyWI: async function (executionContext) {
var formContext = executionContext.getFormContext();

var relatedLegalEntityID = formContext.getAttribute("rbscrm_relatedlegalentityid").getValue();
if (relatedLegalEntityID != null) {
var opportunityId = formContext.data.entity.getId();
var legalEntityId = relatedLegalEntityID[0].id;
var scopeJourney = formContext.getControl("rbscrm_inscopeforbblendingjourney");
if (scopeJourney != null && scopeJourney != undefined) {
var scopeJourneyValue = formContext.getAttribute("rbscrm_inscopeforbblendingjourney").getValue();
if (scopeJourneyValue == true) {
var oppcondition = "";

if (opportunityId != "")
oppcondition = "<condition attribute='rbscrm_opportunity' operator='ne' value='" + opportunityId + "' />";


executionContext.getEventArgs().preventDefault();
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
"<entity name='rbscrm_workitems' >" +
"<attribute name='rbscrm_workitemsid' />" +
"<attribute name='rbscrm_name' />" +
"<order attribute='rbscrm_name' descending='false' />" +
"<filter type='and'>" +
"<condition attribute='rbscrm_workitemtype' operator='in'>" +
"<value uiname='Lending Journey - Customer Initiated' uitype='rbscrm_servicecategory'>{" + LendingJourneyCustomerInitiated + "}</value>" +
"<value uiname='Lending Journey - Staff Initiated' uitype='rbscrm_servicecategory'>{" + LendingJourneyStaffInitiated + "}</value>" +
"</condition>" +
"<condition attribute='rbscrm_journeystage' operator='eq' value='332450000' />" +
"<condition attribute='statecode' operator='eq' value='0' />" +
"<condition attribute='rbscrm_legalentity' operator='eq' uitype='account' value='" + legalEntityId + "' />" +
oppcondition +
"</filter>" +
"</entity ></fetch > ";

var encodedFetchXml = encodeURI(fetchXml);
var results = await new Promise(function (resolve, reject) {
var req = new XMLHttpRequest();
req.open('GET', Xrm.Page.context.getClientUrl() + '/api/data/v9.0/rbscrm_workitemses?fetchXml=' + encodedFetchXml);
req.setRequestHeader('Prefer', 'odata.include-annotations=' * '');
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.onload = function (e) {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
if (results != null) {
resolve(results);
}
else {
Xrm.Utility.alertDialog(this.statusText);
reject(null);
}
}
}
};
req.send();
});
if (results != null) {
if (results.value.length > 0) {
message = "This customer already has an inflight Lending Journey application in the Pre Credit stages";
//formContext.ui.setFormNotification(message, "WARNING", "OpportunityCreateWarning");
Xrm.Utility.alertDialog(message, null);

}
else {
formContext.data.entity.removeOnSave(RBSCRM.Opportunity.FormEvents._opportunityOnSave_DuplicateLendingJourneyWI);
formContext.data.save().then();
}
}
else {
formContext.data.entity.removeOnSave(RBSCRM.Opportunity.FormEvents._opportunityOnSave_DuplicateLendingJourneyWI);
formContext.data.save().then();
}
}
}
}
},

I have the same question (0)

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans