web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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

I have the same question (0)
  • Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    Are you not able to access it using

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

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    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

  • Nagaraj M Profile Picture
    161 on at

    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.

  • Nagaraj M Profile Picture
    161 on at

    Thanks Rawish,

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

  • Viswanath Profile Picture
    93 on at

    Hello Nagaraj,

    Can you please post the correct  answer ?

    Thank you.

  • Suggested answer
    WilliamM Profile Picture
    5 on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans