Ruruboy
Ruruboy

Reputation: 662

window.parent.Xrm.Page.data.entity.getId() is null on SAVE in Javascript using CRM 2011

When I try to re-save(as the entity record already exists) an entity record I want to retrieve the GUID in JS to do some comparing etc...
For some reason window.parent.Xrm.Page.data.entity.getId() "Error: ....is null or not an object.
I even tried window.top.opener.parent.Xrm.Page.data.entity.getId() but still get "Error: ... is null or not an object."
Upon investigation my syntax seems to be correct but the object is coming back as null. I even tried getting the GUID for the entity record on Form Load but still null. Can let me know how I can resolve this issue and provide me a workaround solution?

function Save(executionObj)
{
.....
alert(window.parent.Xrm.Page.data.entity.getId());
}

Upvotes: 1

Views: 2699

Answers (1)

Ruruboy
Ruruboy

Reputation: 662

I removed the window.parent and it worked.

Upvotes: 2

Related Questions