Search code examples
javascriptdynamics-crmdynamics-crm-2013dynamics-crm-online

Obtain parent attribute on load of sub-grid form


I have a form for an Entity A with a sub-grid for Entity B on it. The form for the sub-grid (Entity B) contains an option-set and my requirement is to restrict the values one can select on the Entity B form based on an attribute value of the Entity A. How do I obtain the Entity A attribute value on the Entity B form using JavaScript?


Solution

  • I used the SDK.REST.retrieveRecord function. We can get the parent record ID (Here the Entity A) from its lookup field on Entity B (Entity A has a 1:N relationship with Entity B) and retrieve all related records using the REST function above.