Formula Field in Salesforce
Have you ever thought about, can we have a field in a Salesforce Object which will be auto populated according to a certain condition of the record. Like a date which will automatically be 5 days ahead of the create date. Or a checkbox which will automatically become false when the value of some other field reaches below a certain value. I can’t say for sure if it happens in SQL, but I am confident that this happens in Salesforce. This is what I will be talking about today, how to use formula field in Salesforce.
Formula Field
In Salesforce we have a field type which is called Formula. This type of field is specifically used to set the value on the basis of evaluation criteria. Here in this example I will show you about using this field so that, for every contact we will have a field whose value will be same as phone number of that contact’s account phone.
First go to the field listing of contact from Setup|Customize|Contacts|Fields. Then create a new field, and select the type of this field as Formula. Click on next after that.
Let us take the name of this field as Account Phone and select the formula return type as text. Click on next after this.
Here You have to define the formula or I must say, the conditions and values for each condition. For this example we do not need to specify the condition, all we have to do is select the field whose value we need here. First You need to click on Advance Formula tab.
After that click on the Insert Field button.
Now you have to navigate to the account phone field. Simply go to the contact fields, select the account field there and then select the Phone field in the new box. Click on insert after that.
With this done we have successfully setup the field. Now there is only on more thing to do. You must check your syntax before moving forward to save the next step.
Click on next, and set the field level security, and then the layout assignment on the next page. With this done your field is completed. Go to any existing contact and check the value of the field. It will be exactly same as the value of the account phone.
Support
That’s all about using Formula field in salesforce, for any further queries feel free to contact us at:
https://wedgecommerce.com/contact-us/
Or let us know your views about this blog in comments section below.