Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Passing formcontext to javascript inside ApplicationRibbon

Posted on by 5

Hi,

I have a button inside the ApplicationRibbon. The button executes some JavaScript. I want to refresh the ribbon after that to reflect the changes made.

My problem is that I don't have access to the formcontext when using a button inside the ApplicationRibbon. Right now I have to use the deprecated Xrm.Page.ui.refreshRibbon() to accomplish this. Passing the Crm Parameter PrimaryControl doesn't help because I only get passed null instead of the actual form context inside the javascript function.

pastedimage1640185256752v2.png

Is there any way to refresh the ribbon without using the formcontext without refreshing the whole page? Or is there a way to pass the formcontext to a function inside the ApplicationRibbon?

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Passing formcontext to javascript inside ApplicationRibbon

    Hi,

    Have you tried passing the SelectedControl CRM Parameter?

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Kaladin04815 Profile Picture
    Kaladin04815 5 on at
    RE: Passing formcontext to javascript inside ApplicationRibbon

    Yes, I have 2 buttons inside the ApplicationRibbon with Enable Rules attached to their commands. I want the EnableRules be recalculated after finishing the javascript function to show/hide the buttons.

  • Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: Passing formcontext to javascript inside ApplicationRibbon

    Hi,

    Can you please explain more about need of refreshing the application ribbon?

    Are you implementing show/hide functionality for application ribbon and for show/hide you are making the async call ?

    Thanks,
    Pradeep.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans