Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Refresh Screen from Ribbon and Stay on same Tab

Posted on by 180

Hello,

Is there a way to configure the refresh to keep the users on the current tab after they hit the Refresh button in the Ribbon (not browser)? 

For example, we have a My Work tab and Interaction tab on the lead. If I am on the Interactions tab and I hit refresh, it takes me back to the My Work tab.

pastedimage1684856598918v2.png

  • nvrhughes Profile Picture
    nvrhughes 180 on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Bipin Kumar I did, and there are no hide actions or any functionality surrounding this button in the XML.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Hi,

    I have done multiple times in my previous project but it is strange that you are facing this issue.

    Can you try exporting the solution , open customization.xml and check the RibbonDiff tag to understand what is happening ?

  • nvrhughes Profile Picture
    nvrhughes 180 on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

     Xavier Monin Bipin Kumar Thank you both. Have you ever un hid a button from ribbon workbench and still not have it display in Dynamics or re-appear in Ribbon Workbench? We had a hide action on the Focus View field that we un-hid, but it still wont show in Dynamics or RW. You can still see the hide action in debug but not RW. I refreshed Ribbon Metadata multiple times. 

    pastedimage1685020976029v2.png

  • Suggested answer
    XM-22040801-0 Profile Picture
    XM-22040801-0 11 on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Hi,

    You can customize the Refresh button with a JS script that refresh data of the current record.

    If you call formContext.data.refresh(false), the data of the form will be refreshed without losing the current tab. This call will not reload the form, only the data.

    You can do it with Ribbon Workbench:

    1. Find the button named "Mscrm.Form.<your entity name>.RefreshModernButton".
    2. Right click => Customize Command
    3. Select Mscrm.Modern.refreshCommand
    4. Replace the web resource by your own and set your javascript function (See my JS file bellow).
    5. Publish
    6. If you get an error about "OrRule".
      1. Go to Mscrm.HideInOfflineAfter2022
      2. Remove the OrRule
      3. Add CrmOfflineAccessStateRule with State = Offline, InvertResult = True.

    The JS function:

    function refresh(selectedControl) {
        const formCtx = selectedControl;
        
        formCtx.data.refresh(false);
    }

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Hi,

    Instead of hiding oob button you can attach enable rule and add js code to always return false

  • nvrhughes Profile Picture
    nvrhughes 180 on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Thank you Bipin Kumar Do you recommend hiding the current refresh using ribbon workbench? We previously have hid buttons using ribbon workbench ( Focus View button ) and then later un-hid but they still wont show in Dynamics. Microsoft said they do not support Ribbon Workbench so no one could help.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,962 Moderator on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Hi,

    With oob button it will not be possible to achieve what you need

    How about creating custom button and 1. write Js code to get tab which is expanded and

    2. then refresh the form using core, 3. then set the tab expanded based on the value you have from step -1

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,321 Most Valuable Professional on at
    RE: Refresh Screen from Ribbon and Stay on same Tab

    Hello,

    As far as I know, that's not configurable.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans