Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

getting the Parent form context inside editable subgrid event

(0) ShareShare
ReportReport
Posted on by 161

Hi team,

I have one requirement  to lock the editable sub grid based upon the status field value which is on the parent form.

i created one function and triggering it onrecordselect event of the editable subgrid, but here in subgrid context i am only getting the fields which are available in the subgrid but unable to get the fields on the parent form.

below is the function

function LockRowSelected(context) {
context.getFormContext().getData().getEntity().attributes.forEach(function (attr) {
attr.controls.forEach(function (c) {
c.setDisabled(true);
})
});
}

so does any one have idea to get the parent form field values so that i can conditionally lock the sub grid.

Thanks,

Nagaraju Matta.

*This post is locked for comments

  • Suggested answer
    WilliamM Profile Picture
    WilliamM 5 on at
    RE: getting the Parent form context inside editable subgrid event

    I had a similar issue and Xrm.Page.getAttribute('formfield').getValue(); worked for me.  I wasn't able get any method to work using formContext.

  • Viswanath Profile Picture
    Viswanath 90 on at
    RE: getting the Parent form context inside editable subgrid event

    Hello Nagaraj,

    Can you please post the correct  answer ?

    Thank you.

  • Nagaraj M Profile Picture
    Nagaraj M 161 on at
    RE: getting the Parent form context inside editable subgrid event

    Thanks Rawish,

    can't we do it without this extra wepapi call ?

  • Nagaraj M Profile Picture
    Nagaraj M 161 on at
    RE: getting the Parent form context inside editable subgrid event

    actually we are implementing this using latest v 9.0 syntax , using formcontext and we are avoiding Xrm object model as it is going to deprecated in future releases.

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: getting the Parent form context inside editable subgrid event

    Okay, so when you say field from parent form it actually means the value from current form.

    what you want to do is get value from the records which are there in the subgrid. I think best way to do this is to retrieve the ID of the record in the subgrid and do a web api request to retrieve the field values you want :

    msdn.microsoft.com/.../dn932126.aspx

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: getting the Parent form context inside editable subgrid event

    Hi,

    Are you not able to access it using

    Xrm.Page.getAttribute('formfield').getValue();

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans