Render condition based on child records

Emily DavisEmily Davis ✭✭✭✭
edited January 12, 2018 in Ideas
Is this something that's already been suggested? I have a table with a drawer of related records. It would be really cool to be able to render a drawer action based on whether a table row has any related child records.
2
2 votes

Under Consideration · Last Updated

Comments

  • Jack SanfordJack Sanford San Antonio, TX 💎💎
    edited January 12, 2018
    Great idea! You can achieve this in the XML, someone else may know a different way --

    Set a render condition for a specific field to != Null - blank value on your row action, then search by your field name to look for a section similar to this in your XML:

                                 <rendercondition type="blank" fieldmodel="ModelName" sourcetype="fieldvalue" sourceproperty="hasRows" operator="!=" nosourcerowbehavior="deactivate" field="FieldName__c" value="null" enclosevalueinquotes="false"/>

    Then replace the field name with either ChildName.records if it is a standard field or ChildName__r.records if it is a custom field (you can tell by looking at the child field on your field, if it says just Contacts do Contacts.records, if it says Contacts__r do Contacts__r.records)

    So the resulting XML should look like:

     <rendercondition type="blank" fieldmodel="ModelName" sourcetype="fieldvalue" sourceproperty="hasRows" operator="!=" nosourcerowbehavior="deactivate" field="Contacts.records" value="null" enclosevalueinquotes="false"/>

    I got this to work, let me know if you have any issues. :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!