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
mdinatalemdinatale 

SOQL delete the date value

This is probably simple but i can't seem to figure this out. Just want to make the date field blank, what ever date is it it, make it gone :-). I get a not valid value. Thanks in advance

 

$theID = $record->Id;
		           $setA = array(            		    
			   'Appointment_Date_Time__c' => NULL,
			   'fixdate__c' => 'Y'            				
            				);
			 $saveObj1 = new SObject();
            		 $saveObj1->fields = $setA;
            		 $saveObj1->type = 'Work_Order__c';
			 $saveObj1->Id = $theID; 								 		
          		 $allOBJ[] = $saveObj1; 
								 
			if(!empty($allOBJ)){
              		   $createResponse = $mySforceConnection->update($allOBJ);
										 
              }	

 

asish1989asish1989

Hi

  Try this....

       

   Date myDate = date.newinstance(2010,12,23);
   myDate = null;

   Appointment_Date_Time__c = myDate;

 

 

 

I think It will work....

  Did this solve your problem ,If so please mark it solved so that others get benified...

 

Thanks

asish