0

I am new to Salesforce and I am unsure when I should use a formula, versus when I should use a Flow.

We just started using a new external HR system that assigns values to each of our employees, and we need to track these numbers in our system, so on the User object we created a field called:

ExternalHrEmployeeNumber

On our Opportunities, I also created a field called:

ExternalHrEmployeeNumber

I think maybe I can create a formula that looks like this:

 $User.ExternalHrEmployeeNumber__c 

And set the "Function" to be "TEXT" so that this is copied over as a text value?

Would the value copy over automatically?

Or I could create a Flow that triggers whenever an Opportunity is created?

One more question:

On the Opportunity, if I create a custom field, I see I can create a formula that allows me to set the value to $User.ExternalHrEmployeeNumber__c , but in this case does $User refer to whoever created the record, or to the current user, who might be modifying it?

6
  • Do you want to populate the field from User object? Mar 6 at 11:20
  • Assuming you don't have too many unique relationship paths, and you have a relationship from the one object to another, cross-object formula fields can simplify your implementation. Read more here.
    – Phil W
    Mar 6 at 11:20
  • Yes, I want to copy the value from the User object to the Opportunity. Mar 6 at 11:43
  • One more question, on the Opportunity, if I create a customer field, I see I can create a forumla that allows me to set the value to $User.ExternalHrEmployeeNumber__c , but in this case does $User refer to whoever created the record, or to the current user, who might be modifying it? Mar 6 at 11:51
  • Do you want to show the current user's ExternalHrEmployeeNumber field? Mar 6 at 12:01

1 Answer 1

1

If you want the current user's ExternalHrEmployeeNumber who is viewing the record you can use formula field and use $User.ExternalHrEmployeeNumber__c. Only issue is formula fields are not editable .

If you want Created user's ExternalHrEmployeeNumber you can use CreatedBy.ExternalHrEmployeeNumber__c in formula.

If you want that field to be editable in UI then you may have to use Flow to populate the value.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .