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
Harsha sharma 14Harsha sharma 14 

I need to create a validation rule where a custom field end date /time is greater than 6pm then it should throw error End date field is custom and calculated upon saving of two field (start date/time + span hours) Below is the rule created but not worki

 I need to create a validation rule where a custom field end date /time is greater than 6pm then it should throw error
 End date field is custom and calculated upon saving of two field (start date/time + span hours)

Below is the rule created but not working as expected
AND(
    ISNEW(),
    ISPICKVAL(OCE__SpanType__c, "Hours"),
    IF(
        OCE__EndDate__c > DATETIMEVALUE(TODAY()+(21/24)),
        TRUE, FALSE
    )
)
RajivKocherlaRajivKocherla
Hi Harsha,
                 Can you please tell the names and datatypes of those fields??
1) Is End the name of the formula field ?? And it adds span hours field and start field right??
2) Can you please tell me what are the data types of span hours field and start field??
3) After you tell the above information please elaborate your question??