web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Issue with data.entity.save in Unified Interface

(0) ShareShare
ReportReport
Posted on by
Hello,
 
We are using Dynamics CRM (on Premise) version 9.0.28.1.
 
I have a very simple javascript that gets the Record Id, puts it in a field and saves the form.  This is set to run on load in event handlers as I need to make sure the Record Id field is populated prior to workflows that run that require the field.  That said, we have been transitioning over to Unified Interface and with this Function running, I'm hitting a few issues:
 
  1. The forms this runs on have required fields that must be filled out before the form is saved.  Since the Function runs on load, we get the /A required field cannot be empty/ warning on all fields.
  2. When the record is saved, we get an error saying /Saving in Progress/.
The JavaScript Code is:
 
function PopulateGUID()
{
Xrm.Page.getAttribute(/ds_guid/).setValue(Xrm.Page.data.entity.getId().replace(/}/,//).replace(/{/,//));
Xrm.Page.data.entity.save();
}
 
From the bit of reading I've done it looks like I should transition to using formContext or something, but I am not 100% familiar with this.  Any guidance or example of how I can make it so that I get the record id, populate it in a field and save the form on load without getting the issues above would be much appreciated. 
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 179 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans