Avdhut Vaidya
Avdhut Vaidya

Reputation: 334

Refreshing Ribbon in CRM on home screen (no entity form open)

On my home screen, I have a button for Login and a button for Logout. Initially, the button Login is Enabled and Logout is disabled. On click of Login button, i make an AJAX call and login the user to a system. Now, on this, i want the Logout button to be clickable and want to grayout the Login button. I have a corresponding javascript written. However, i want to refresh the Ribbon button. How do i do that?

when i try Xrm.Page.ui.refreshRibbon, it breaks saying refreshRibbon is invalid. When i tried watching Xrm.Page.ui.. it returns NULL.

Upvotes: 0

Views: 1754

Answers (1)

Dot_NET Pro
Dot_NET Pro

Reputation: 2123

I think you are already in the XRM Ribbon Context so you can use the XRM Ribbon Related functions directly in the Ribbon button's JS.

try

window.refreshRibbon() 

Upvotes: 2

Related Questions