locked
Enable and Disable ribbon custom button RRS feed

  • Question

  • I have a very simple scenario, where I have a custom button on dashboard page ribbon of dynamics crm online, ribbon functions in a very simple way like this:

    • On click a new browser window opens
    • On clicking again the browser window loads again.

    What I am required to do is that I want to disable the Custom Ribbon Button when it is clicked and new window is opened, and when new window is closed I want to enable the button again. 

    I am using Ribbon Work Bench for ribbon customization and rule definition. Thanks in advance for any help/guidance. 

    Friday, September 20, 2013 5:56 AM

All replies

  • Hi,

    Glad to hear you are using the Ribbon Workbench ;)

    You will need to use a Custom JavaScript action that sets a flag (say 'window.customWindowOpened=true') then make a call to:

    Xrm.Page.ui.refreshRibbon()

    When the window is closed, you should then reset the customWindowOpened flag to false and call refreshRibbon again.

    The magic will be in the Enable Rules - add a custom Enable Rule that calls a JavaScript function that returns the inverted value of the window.customWindowOpened flag.

    hth,

    Scott



    Scott Durow
    Blog www.develop1.net    Follow Me
    Rockstar365
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, September 20, 2013 8:20 AM
    Answerer
  • Thanx Scott :)
    Friday, September 20, 2013 9:20 AM