function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jayant Umrani 11Jayant Umrani 11 

Trailhead: Formulas & Validation

I am trying to solve the challenge to create a field on Contract called Days Remaining and use formula editor to calculate the days left for the contract to end. The formula I am trying is:
EndDate - TODAY()

I get the following error when on Check Syntax: Error: Field EndDate may not be used in this type of formula

Can you help me on what is incorrect here?
Nathan EhrmannNathan Ehrmann
Hmmmm. I am not sure if this will help, but try this:
  1. Contracts > Contract Settings
  2. Set "Autocalculate End Date" to FALSE and Save.
I tested with this in both TRUE and FALSE and was still able to create the formula field, but that is my only theory here.

Also, check the output type of the formula. Make sure that it is Number. It may be tempting to select Date since we are dealing with two dates.
Ajay K DubediAjay K Dubedi
Hi Jayant,

I'll suggest to use with the Advance Formula tab, then select your field using the Insert field button. The problem may be arising due to incorrect field API. 

Please refer the below screenshot:
User-added image

Thank you,
Ajay Dubedi