Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have recently been using cross object formulas (I'll use COF for notation) for the first time, and as far as I can tell the only way to use fields from another object is if the lookup is from the object upon which the formula field is being added.

That is: if Object A has a lookup field to Object B, I can only add a COF field to object A referencing fields on Object B - I cannot add COF field on object B referencing fields on object A.

Is this correct? Or am I missing something?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

That's correct. When you create a lookup from A to B you are creating 1:M model or Parent-Child model, which means that object A (Child) can only reference only 1 record of object B (Parent), but record from object B can be referenced from many object A records - parent can have many children.

If you were to create a formula field on the object B (Parent), how would you know which record from the object A (Child) to reference in your formula field when there might be more than 1 children? At this stage the formula fields don't have the functionality to work with children. In order to do that you might need to write an apex code (trigger or class) that will retrieve specific children records (by executing SOQL Query) and then write your own custom logic and work with the records.

share|improve this answer
    
Thank you for the confirmation and explanation of the reasoning - you are the man Boris! The records I'm using are from an integration and I'll use a trigger to update the field directly. Thanks.. again! –  Cerbera Mar 27 at 1:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.