1
votes

I am new to CRM and I have an exiting ribbon button. I want to disable it on condition (Field1 is null or not).

So far, I have created an new solution and included the required entity. Exported the solution and tried to change the configuration.xml.

I have tried to make change under . But without any luck.

Can anyone help me out with an example.

Thanks in advance.

1

1 Answers

4
votes

Don't edit it by hand. Use The Visual Ribbon Editor Tool. Makes things much nicer to deal with than hand editing the xml.

If you want to setup a button to be enabled if new_field1 (capitalization matters so make sure it's correct with what your field's actual name is) is not null, here is what you would do:

  1. Open up the ribbon editor
  2. Conenct to your org
  3. Select your entity with the ribbon button you want to enable/disable
  4. Click on your button
  5. Click the Enable Rules tab
  6. Enter the field name exactly as it appears in the customization section of your solution within CRM in the Field text box.
  7. Enter "null" (without the quotes) for the value. Lower case.
  8. Skip Default (if you have some custom forms where the field does not exist, you may want to give it a default value)
  9. Change Invert Result to true.
  10. Click the "Save" button at the very top. (don't click the save button on the main tab of the ribbon)
  11. Verify that it is getting deployed and published.
  12. Test it out.

Edit: Use Ribbon Workbench For System Ribbons

I've never used it, but the Ribbon Workbench says it can customize system buttons.