Newer Version Available
Try It Out: Give Fields Dynamic Default Values
We can also use custom formulas to give our fields dynamic default values. While some fields like the Travel Required checkbox or the Job Location picklist have default values that apply in every situation, there are other fields with defaults that can't be so easily defined. For example, at Universal Containers, recruiters are generally expected to fill a position within 90 days of it being opened. While we can't choose a single date that will always be 90 days after a position is opened, we can define a custom formula that takes the date the position is created and adds 90 days. The platform allows us to specify this formula as the Hire By field's default value:
- From Setup, click .
- Click Position.
- In the Custom Fields & Relationships related list, click Edit next to the Hire By field.
- Next to the Default Value text box, click Show Formula Editor.
Look familiar? This is similar to the editor that we used to define our Days Open custom formula field.
- From the Functions list, double-click TODAY.
- Click the Insert Operator button, and choose Add.
- Type 90.
Your default value formula should be:
1TODAY() + 90- Click Save.
It's that easy! Now to wrap up the fields on our Positions tab, let's set the default value of the Open Date field to the day that the record is created. To do this, follow these steps again, but use TODAY() as the Default Value.