Fetch current record’s GUID/Name

Access GUID of opened current record on browser it self. We can do it by using a little bit of JavaScript.

  1. Open IE
  2. Press F12 to open Developer Tool
  3. Type JS in Developer Console
  4. Run JS
  5. Press F12 >> developer console >>

JavaScript to get GUID

var id =frames[0].Xrm.Page.data.entity.getId();

JavaScript to get entity name

var entityName = frames[0].Xrm.Page.data.entity.getEntityName();

Similarly, following functions may useful

Method Description
addOnSave Sets a function to be called when the record is saved.
getDataXml Returns a string representing the xml that will be sent to the server when the record is saved.
getEntityName Returns a string representing the logical name of the entity for the record.
getId Returns a string representing the GUID id value for the record.
getIsDirty Returns a Boolean value that indicates if any fields in the form have been modified.
removeOnSave Removes a function from the OnSave event hander.
save Saves the record. This method has three possible parameters.

Thanks. !!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s