How to Hide Declarative Action in Record List Component Based on Parent Record Field Value?

hamidouche
Mega Expert

Hello Community,

I'm trying to conditionally hide a Declarative Action ("New") in a Record List Component within a workspace based on the parent record's field value.

Setup:

  • Parent Table: x_parent_table (appears in workspace)
  • Child Table: x_child_table (related list via Record List Component)
  • Relationship: Child Table has a reference field cfem pointing to parent
  • Goal: Hide the "New" action when parent.stage = 'locked'

What I've Tried:

1. Client Conditions in Declarative Action:

  • The Action Model Fields dropdown doesn't include any parent or parentRecord field
  • Only shows fields from the Facilities table itself (query, count, groupBy, limit, page, etc.)
  • No access to parent record context

2. Script Condition in Declarative Action:

 
 
javascript
var cfemGR = new GlideRecord(childTable);
if (cfemGR.get(current.cfem)) {
    return cfemGR.getValue('stage') != 'locked';
}
return true;
  • current is not available in this context
  • Script condition doesn't execute or has no effect

Limitations Found:

  • Declarative Actions don't have access to current record in Script Conditions when used in Record List Components
  • Client Conditions Action Model doesn't expose parent record context
  • Cannot reference parent fields through the child relationship

Question:

How can I conditionally show/hide a Declarative Action in a Record List Component based on the parent record's field value?

Is this possible through:

  • UI Builder component configuration?
  • Client State Parameters?
  • A different approach entirely?

Any guidance or workarounds would be greatly appreciated!

0 REPLIES 0