In MS CRM 2011 (on premise), I have 2 related entities, let's say A and B (1:N).
On a Form for A entity, I have associated view for entities B. Clicking on it will open a list of related entities B. Then I click "Add new B". When saving new entity B from this associated view, I want to perform a javascript check which needs ID of entity A to pass it to FetchXML query (javascript is attached onSave event, before B is saved).
How can I get entityId of associated entity A with javascript?