locked
Enable and Disable Ribbon buttons on basis of Response Values from an External Web Service RRS feed

  • Question

  • I have two custom ribbon buttons, one button say start and the second button say end. Now I want the "Start" button enabled and "End" button disabled by default. Now when the Start button is clicked a web service is invoked which sends a particular value as a response. Now I want to decide on the basis of response value that whether I have to enable the "End" button and disable the "Start" button. How can I do this on the basis of response value? I am using Ribbon Workbench to edit the ribbon.
    Monday, September 30, 2013 6:50 AM

All replies

  • Hello,

    You can create a field to capture response from your web service, and can use value rule against this field to enable/disable your ribbon button.


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Monday, September 30, 2013 7:15 AM
    Moderator
  • Thanx, I got the idea, so how I am going to create a field under the given scenario?
    Monday, September 30, 2013 7:22 AM
  • It depends on what type of response you are getting, if it's text you can create textfield or if getting true/false can create two optionset...

    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Monday, September 30, 2013 7:25 AM
    Moderator
  • I am getting simple text response, but how I am going to determine that which entity field I should use to store value? as my custom buttons are on the ribbon of dashboard.
    Monday, September 30, 2013 7:30 AM
  • Hi Absaar,

    In Addition to what Mahender proposed ,You can create any Custom entity like Web Service Config that will store your response in custom field.

    You can write Custom Rule that will call the JavaScript function. In JavaScript you can retrieve Web Service Config entity and return true or false based on the value retrieved.

    Thanks!

    Monday, September 30, 2013 8:01 AM
  • I have created a custom entity with a custom field, which will store the response from Web Service. While on the dashboard how I will use java script to set the value of custom entity field and then get the value of custom entity field? Xrm.page doesn't seem to help here.
    Monday, September 30, 2013 8:49 AM
  • Hello,

    you need to use ClientGlobalContext.js.aspx to get context while working out side of crm form.

    HTH


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Monday, September 30, 2013 8:59 AM
    Moderator
  • I have got the reference, but how to utilize this to get my task completed ?
    Monday, September 30, 2013 9:17 AM