locked
Problem using Ribbon Workbench to disable adding from subgrid RRS feed

  • Question

  • Hi,

    I'm not sure that I understand how the Ribbon Workbench works for the add button on subgrids.  On the contact form, I have an n:n relationship for a custom entity called Contact Group.  I want to disable the add button for Contact Group based on the value of another field that's on the Contact form.

    In the Ribbon Workbench, am I supposed to be adding an Enable rule on the Contact entity?  or on my Contact Group entity?  I've added the rule to Contact Group entity, but it just disables the add button no matter what.  It seems that it can't find the value (probably because the field is on the Contact Form and not the Contact Group form?).  How am I supposed to set this up?

    Thanks.

    Monday, January 12, 2015 9:17 PM

Answers

  • Hi,

    If you need to edit the ribbon/command bar for a subgrid of a particular entity, then you need to load that entity into the ribbon workbench - so in your case it is the 'Contact Group' entity's subgrid you need to edit. That said, the ValueRule does not pickup values from the parent entity form - it can only be used to control commands on the form ribbon. You will need to create an EnableRule that runs a custom javascript rule that uses the parent.Xrm object to get the value from the form and control visibility.

    Hope this helps.

    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"

    • Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, January 13, 2015 9:19 AM
    • Marked as answer by PandaM Tuesday, January 13, 2015 1:25 PM
    • Unmarked as answer by PandaM Tuesday, January 13, 2015 8:28 PM
    • Marked as answer by PandaM Friday, January 16, 2015 7:21 PM
    Tuesday, January 13, 2015 9:19 AM
    Answerer