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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Issue with FormContext in Subgrid on the Second Page of Subgrid Event

(1) ShareShare
ReportReport
Posted on by

Hello,

I'm currently facing an issue with the FormContext in a subgrid, specifically on the second page of a subgrid on record select event. I'm hoping someone here can provide some guidance or shed some light on this problem.

Here's a brief description of the problem I'm encountering:

  1. I have a subgrid on a form that displays a list of related records.
  2. I've implemented a subgrid on the record select event.
  3. On the first page of the subgrid rows, I am able to access the form context in the record select event. However, when I navigate to the second page of the subgrid without clicking on any row of the first page and try to select a record from the second page records, I am unable to get Form Context in on the record select event.

I've checked the available documentation and community resources but haven't found a specific solution to this problem. I suspect there might be something related to the page lifecycle or the way the subgrid event is handled, but I'm not entirely sure.

If anyone has encountered a similar issue or has any insights on why the FormContext might not be available on the second page of a subgrid event, I would greatly appreciate your help. Any suggestions, workarounds, or pointers in the right direction would be immensely valuable.

Thank you in advance for your assistance!

Best regards,

Vinit Pipaliya.

I have the same question (0)
  • Amandeep Singh (Defacto Infotech Mohali) Profile Picture
    26 on at
    Hi 
    Use Xrm Web Api retrieveMultipleRecords
     
     
    Xrm.WebApi.retrieveMultipleRecords("Subgrid Entity name", "?$filter=_primarycontactid_value eq "+ YourDynamicIdOfRecord).then(
        function success(results) {
            console.log(results);
            for (var i = 0; i < results.entities.length; i++) {
                var result = results.entities[i];
                // Columns
                var accountid = result["accountid"]; // Guid
            }
        },
        function(error) {
            console.log(error.message);
        }
    );
  • powerQuest Profile Picture
    2 on at
    I have the same issue. Did you get any solution for this?
  • yannickhuo Profile Picture
    4 on at
    I have exactly the same issue. Is it a recent bug ?
  • Suggested answer
    yannickhuo Profile Picture
    4 on at
    Next to my response on 7 July, I find a workaround if you want to manipulate grid columns.
     
    For example, this function will disable all columns for a grid "documents". I call this function on OnRecordSelect event.
     
    function DisableAllColumns_DocumentsGrid() {
        var docGrid_control = globalformcontext.getControl("documents"); // globalformcontext is a variable initialized on OnLoad event
        var docGrid_grid = docGrid_control.getGrid();
        var docGrid_selectedrows = docGrid_grid.getSelectedRows();
        docGrid_selectedrows.forEach(function (row, i) {
            var gridrowdata = row.data;
            var gridEntity = gridrowdata.entity;
            var attributes = gridEntity.attributes;
            attributes.forEach(function (gridattribute, j) {
                var name = gridattribute.getName();
                var controls = gridattribute.controls;
                controls.forEach(function (gridcell, k) {
                    gridcell.setDisabled(true); // read only
                });
            });
        });
    }

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 > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 165

#2
ManoVerse Profile Picture

ManoVerse 156 Super User 2026 Season 1

#3
Zhilan Profile Picture

Zhilan 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans