How to Use Related Object Fields in Redwood Layout Conditions for a Custom Object?
We have a custom object called Part Details. This object is not a child of Lead or Opportunity, but it is linked to both of them as a related object.In the Classic UI, we were able to build layout conditions using fields from the related Lead and Opportunity records.——————————————————————————————————————————————————
if (Lead_Lead_Part_Details_Src?.StatusCode === 'CONVERTED') { return true;} else { return false;}
AND other condition
if (Opportunity_Opty_Part_Details_Src?.SalesStageId === 300000002508240 ||Opportunity_Opty_Part_Details_Src?.SalesStageId === 300000002508241 ||Opportunity_Opty_Part_Details_Src?.SalesStageId === 300000002508242) {return true;} else {return false;}
————————————————————————————————————————————
Now we are moving to Redwood layouts, but Redwood layout conditions only allow conditions based on fields that belong to the current object. Fields from the related Lead or Opportunity records are not directly available within layout rules. We need to achieve the same behavior that we previously had in the Classic layout engine.