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)

Refresh Quick View From

(0) ShareShare
ReportReport
Posted on by 334

I have a requirement to Display a Subgrid of Contact (Parent) Address on a child record,

So I decided to go with the Quick View Form, however when the Look up is changed I need to refresh the Quick View form even thou the system refreshes it automatically.

But there is no change in the Subgrid.

I have written a javascript function.

function refreshQuickView()
{
  var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");
	if (quickViewControl != null) 
	{ 
         setTimeout(function () 
	{ 
	quickViewControl.refresh(); 
	}, 900); 
	} 

}

I also tried this to make is easier.

function refreshQuickView()
{
var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");		
quickViewControl.refresh(); 	
}
	

But the only refresh I see is the system refresh.

How can I make the refresh effective so I can see the correct sub-grid records when the contact look up is changed.

*This post is locked for comments

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

    Where are you calling your script ?? are you attaching to the account lookup if not try to attach it with account lookup, below post deal with the same issue, see if that can be any help

    crmprof.wordpress.com/.../quick-view-form-and-sub-grid-issue

    community.dynamics.com/.../refresh-quick-view-form-control-programmatically-using-new-client-side-api-for-quick-view-forms-in-dynamics-365

  • lawix10 Profile Picture
    334 on at

    I am calling the script on change of the Look up ..its a look up to contact.

    And none of the code works...I have debugged the Javascript..the problem is that the system automatically refreshed the quick view form when the look up is changed and the record is saved...so that overrides my own refresh I guess.

  • gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Try to increase timeout around 3000 ms.

  • lawix10 Profile Picture
    334 on at

    Thanks But this also did not work, i set the time to 3000 then 6000

    on the Debug at the time out function it just jumps to the next stage and does nothing.

    tes14.PNG

    step12.PNG

    Any other suggestions please?

    just an update it then goes to the lookup function

    test13.PNG

    where the refresh method is undefined

    tes14.PNG

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    That means your control is not getting somehow . Try with this -

    function refreshQuickView() {
    
        var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");
    
        if (quickViewControl != undefined && quickViewControl != null)
        {
            if (quickViewControl.isLoaded())
            {
    
                quickViewControl.refresh(); 
    
                return;
            }
            else
            {
                // Wait for some time and check again
                setTimeout(getQuickViewFormAttributeValues, 50);
            }
        }
        else
        {
            // Wait for some time and check again
            setTimeout(getQuickViewFormAttributeValues, 50);
        }    
    }


  • lawix10 Profile Picture
    334 on at

    Thanks but the problem is with the refresh, I think the system refresh over rides the javascript . 

    The quick view control is always returned.

    And the code does not go to else with your new code

    ww33.PNG

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    I am not sure but this should work , I am  just thinking how you are sure that quick view control is not refreshing ?

    Grid data stored cache once loaded , so may be you need separately refresh the grid control inside quick view form. Try to get the  grid control from quick view form and refresh the grid as well.

  • lawix10 Profile Picture
    334 on at

    Thanks I think you are right, so How do I do that?

    So if i have a contact with 2 addresses.

    Another contact with 3 addresses.

    Any time I change the contact look up to the contact with 3 addresses , I excpect the refresh to display 3 addresses and not two which belongs to the contact with two address.

    how do I get the subgrid in the quick view form and also refresh it.

    var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");

    is there a method like quickViewControl.subgrid("addresssubgrid").refresh();

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Try with this  -

    var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");
    
    var grid = quickViewControl.getControl("gridName");
    if (grid != null && grid != undefined) { 
     grid.refresh();
    
    }
  • Sean Scott Profile Picture
    5 on at

    The Quick View Form control refresh() method did not work for either no matter what I tried.  But I did see the same effect by refreshing the form context data.  The Quick View Form updated to show the most recent data.  Link to Data Refresh Method:   docs.microsoft.com/.../refresh

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans