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
saritha78saritha78 

setting datetime? type field to null

Hi,
I have a problem with setting null to a custom field of type to null. I am using the statment
op.apprDateTime__c=null;
op.apprDateTime__cSpecified=true;
 
and here, apprDateTime is of type DateTime?
However, it is not getting updated to null.
 
Does anybody have any idea why this might now work?
Thanks in advance,
Saritha
PS: I have the recommended hotfix (mentioned here) installed.
DevAngelDevAngel
Have you seen the fieldsToNull parameter in the documentation yet?  It works really well.
saritha78saritha78
Ok, I tried the fieldstoNull and it seems to work fine.
But why doesnt setting it directly to null work?
Thanks,
Saritha