In CRM 2011, using javascript, how can I get the calling entity or form type name?

1.1k views Asked by At

In CRM 2011, using JavaScript, how can I get the calling entity or form type name? For example, if I open an activity, I want to see if I opened this activity from an account form or a contact form etc. I have googled this and I am not finding anything.

2

There are 2 answers

2
James Wood On

In that particular case you should check the regarding field - CRM automatically populates this, that should contain the information you require.

0
Sunil On

Use

window.parent.opener.Xrm.Page.data.entity.getEntityName()

This will only work if you have opened up the entity from the calling entities' form.

It will not work if you open up the entity from the related activities section by on the left.

Basically the parent page should have the entity form loaded in order to use the Xrm.Page.data object.