Skip to main content

Hey There 

 

I’ve got objectA & objectB, linked via child>parent relationship where objectA = Parent and objectB = Child

 

Both objects contain multiple unique records within.

 

My goal is to return a value from objectB, based on criteria match between objectA & objectB

 

Formula essentially is:

If( objectA.fieldA = objectB.fieldA && TEXT(objectA.fieldB) = TEXT(objectB.fieldB), objectB.fieldC, “error”)

 

FieldA in each object is TEXT

FieldB in each object is PICKVAL

 

Values in each Field match across the objects, both by field content and case.

 

Cannot get this to work 😞

 

I suspect this might be because I’m trying to get ObjectA to search and match across multiple records within ObjectB?

 

Would love to please hear ideas on how to solve? 🙏🏻 

 

@Formulas - Help, Tips and Tricks

 

 

#Formulas

5 Antworten
  1. 22. Feb., 16:32

    well the formulas can only look "Up" (Child to Parent), never "Down" or "Sideways" (Parent to Child or across unrelated records) and this is one of the limitation we have in salesforce. 

    Why your current logic is failing is bcoz

    Child records have a "hardcoded" link to exactly one Parent and Parent records

    have no field pointing to the children; they only have a "Related List," which is a dynamic query. Formulas cannot run queries.. 

     

    as a best approach, Set a Record-Triggered Flow to run on 'ObjectA' when it is created or updated.

    • The Logic: Use a Get Records element to search ObjectB.
    • Filter where FieldA equals $Record.FieldA AND FieldB (converted to text) equals $Record.FieldB.
    • The Action: If a match is found, use an Update Records element to stamp the value from ObjectB.FieldC into a plain text field on ObjectA.

    This allows you to "search" the database, handle the "error" logic if no match is found, and physically store the value on 'ObjectA' so you can use it in reports or other automation. Let me know if you need any further help on this :)

0/9000