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();
}
}
}
}
},

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 Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans