You need to sign in to do that
Don't have an account?

setting blank value to date field
Hello,
I have a custom field TEXT__C Date.
I set some date. its ok untill now.
From the backed i want to reset the date.
TEXT__C =null; //no error but numm is displyed
TEXT__C =' '; //error saying string value cannot be set to date.
i want to set blank value to the date
I have a custom field TEXT__C Date.
I set some date. its ok untill now.
From the backed i want to reset the date.
TEXT__C =null; //no error but numm is displyed
TEXT__C =' '; //error saying string value cannot be set to date.
i want to set blank value to the date
You have only 2 options to set in this case..
1. Any date
2. Null
You can not assign anything except above 2 to a date type field..
Thanks,
Sandeep
All Answers
single quote'('') represent a string so you can't set like TEXT__C ='';, you should set TEXT__C =null;
You have only 2 options to set in this case..
1. Any date
2. Null
You can not assign anything except above 2 to a date type field..
Thanks,
Sandeep
You can use Text__c = null;
Its working fine for me no null is displayed.
Thanks
Nitin
try:
AccountObj.fieldsToNull = new String[] { "TEXT__c" };
I was struggling with this same issue until using the fieldsToNull