ryan
ryan

Reputation: 188

Records created from Subgrid in CRM 2011

I'm fairly new to CRM. I have created a custom entity (entity 1). It has a n:n relationship to another custom entity (entity 2). Entity 1 contains a subgrid to entity 2. Users can create entity 2 records from either the subgrid on entity 1 OR outside the entity 1 form using standard navigation.

My question is can I tell via jscript onOpen if the entity 2 record is launched via the subgrid on entity 1 or from outside? The form needs to behave differently depending on where it's opened from.

Upvotes: 0

Views: 296

Answers (1)

rocksolid
rocksolid

Reputation: 34

You could try accessing the opener window, and looking at an identifying property.

Try this when loading entity 2: You will have to mess around with making sure these objects exist whenever it is loaded directly.

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

Upvotes: 1

Related Questions