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
Shank_dhelShank_dhel 

How to check null values in Date field ??

Hi,

 

 I have a field called Start_date__C ..

Its not a required field ,

how to check whether the field is null or not??

 

 

 

Thanks in advance..

HariDineshHariDinesh

Hi,


This can be done with simple validation Rule

 

Create a validation rule and copy the below code and save it and try to save the record without giving any value.

It will not allow.

 

ISNULL(Start_date__C)

Shank_dhelShank_dhel

@HariDinesh  : Thank  you for your suggestion .The solution u suggested is fine  but  I don't want to restrict users from entering null values or skipping the data and don't want to set a default date for that field when the user  doesn't enter any value

 

I want to get a filtered list of records which doesn't have that particular field as null or empty...

 

 

Thank you

HariDineshHariDinesh

Hi,

 

If you want Filtered list of records which doesn’t have any particular fields as null then query it like

 

SELECT id, Name FROM TestObject__c  Where Start_date__c =null

 

IF you are not looking for the query please post what you are looking for exactly.

If possible share the Scenario.

Shank_dhelShank_dhel

Hi Hari

 

 

using the query will work for sure

 

also converting hte date field to string checking for null will also work

 

but i'm curious to know is there any direct method will check the null value in date field???