Good day trailblazers!
I've an object with a type field and a due date. The due date has a formula:
IF(OR("API_name"="X", "API_name"="Y", "API_name"="Z"),Today()+30,Today()+7)
When I create a new record, the API_name field is empty, and doesn't match the X, Y an Z value. It therefor defaults to a due date of Today()+7. But here's my issue, when I manually select value X, Y or Z in the API_name field, the Due date field is not being updated according to its formula.
Any ideas how I can manage this?
Eric Praud (Activ8 Solar Energies) Forum Ambassador
Are you trying to create a "normal" date field and is this in the default formula? If so, you cannot use a field on the record:
https://help.salesforce.com/s/articleView?id=000392562&type=1
Q: I am trying to reference a field on the record in the formula for the default value of a field, but it is not available
A: Default values are only available on creation of a record. At that point, no field has any value until the record is saved, hence why you cannot reference any field on the record itself.
You could use a record-triggered flow to populate the field, but this would only show after saving, or you could use a Quick Action and add a predefined value for this specific field
What you need to do is to create a formual field that will return a date, or as stated above, a record triggered flow to update the date field