Hi everyone,
So I'm trying to create a formula field that auto populates with a date, based on the specific text in a picklist value.
If a certain camp is selected in the opportunity record, I want the date to autopopulate to six weeks before the camp begins.
Here's my formula...
IF(ISPICKVAL(Type,"Adventure Camp A (Residential) 22nd – 26th July 2024"), DATE(2024,06,2024), DATE(2024,07,01) )
At the moment, it's only displaying 2024,07,01, but it seems to me that the date should be displaying 2024, 06,2024, because the picklist value for 'Type' is displaying as Adventure Camp A (Residential) 22nd – 26th July 2024.
Can anyone tell me what I'm getting wrong?
Thanks!!
@Thomas Rawling
- Make sure that the formula field's return type is set to "Date". If it's set to "DateTime" or any other data type, it will not display as expected.
- Ensure the formula's syntax is correct without extra commas or parentheses.
- Verify that the picklist value matches exactly as it appears in the formula. This includes checking for trailing spaces, capitalization, and any special characters.
- Sometimes, the formula fields do not recalculate until the record has been updated. Try editing and saving the record to see if the formula recalculates.
- Confirm that the formula field is placed on the page layout and that the field-level security settings allow you to see the field.
- If there are any dependent picklists or other fields that are related to this formula, ensure they are set up correctly.
IF(
ISPICKVAL(Type, "Adventure Camp A (Residential) 22nd – 26th July 2024"),
TODAY() - 42,
TODAY()
)
This will test if the formula can correctly calculate a date based on the current date. If this works, then gradually build up to the desired formula, ensuring each step works as expected