[SalesForce] Formula field – refer to another object

I have 2 objects with some custom fields.

Obj1: Field1(picklist)
Obj2: Field2(Formula), Field3(Checkbox)

I want to say the following:

if field3 is checked AND Obj1.Field1 == 'Value1" THEN assign Value1 to Field2

I am fine with the formula, but I just cannot reference Field1 on Obj1. I tried Obj1.Field1, but that didn't work.

Best Answer

Reading Values

In Formula fields you can only access fields from related objects (master-detail or lookup) and only upstream, that means e. g. on opportunity you can access Account.Name but not OpportunityLineItem.UnitPrice

Writing Values

You can't access related objects. Formulas can not assign values to any other fields but to itself. To do so, you may look into Workflows (limited cross-object capabilities for master-detail relations) or Triggers.

Flows / Lightning process builder

I other option could be to try Visual Workflows, but this I have not verified yet: https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/

According to this post What is the difference between Aura and Lightning frameworks? the Lightning Process Builder is a kind of rebrand of Visual Workflows. If my time allows, I'll have a look into both and give feedback here.

Related Topic