Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Refresh Quick View From

(0) ShareShare
ReportReport
Posted on by 330

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

  • Sean Scott Profile Picture
    Sean Scott 5 on at
    RE: Refresh Quick View From

    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

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Refresh Quick View From

    Try with this  -

    var quickViewControl = Xrm.Page.ui.quickForms.get("ContactAddress");
    
    var grid = quickViewControl.getControl("gridName");
    if (grid != null && grid != undefined) { 
     grid.refresh();
    
    }
  • lawix10 Profile Picture
    lawix10 330 on at
    RE: Refresh Quick View From

    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
    gdas 50,085 on at
    RE: Refresh Quick View From

    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
    lawix10 330 on at
    RE: Refresh Quick View From

    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
    gdas 50,085 on at
    RE: Refresh Quick View From

    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
    lawix10 330 on at
    RE: Refresh Quick View From

    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

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Refresh Quick View From

    Hi ,

    Try to increase timeout around 3000 ms.

  • lawix10 Profile Picture
    lawix10 330 on at
    RE: Refresh Quick View From

    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.

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Refresh Quick View From

    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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans