You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

how to store custom text value in date/time custom field

Received Response
22
Views
7
Comments
edited Dec 13, 2018 7:38AM in Integrations and APIs 7 comments

Summary

Store custom text value in date/time custom field

Content

Hi All,

In ROQL I have received date/time in string format. So I converted into date/time in (MM:DD:YYYY HH:MM") format.

After that, I need to store the converted date/time value in "Date/time" datatype custom field.

While I am trying to store the converted value in date/time datatype field, I am getting error like "Type Mismatch"

How to resolve this?

Thanks,

Seethalakshmi

Version

Version 18C

Code Snippet

$currentDateTime = $res_date;                   /*$res_date--------ROQL query date value*/
$newDateTime = date(' n-j-Y-h:i A', strtotime($currentDateTime));
Print("Resolution_Date:---------------".$newDateTime);
						
$incident = RNCPHP\Incident::fetch($i_id );
$dat=$incident->CustomFields->c->x_resolution_date=$newDateTime;    /*x_resolution_date--------string Field*/
Print ("Date text----------:".$dat);
$incident->save();
							
$time=$incident->CustomFields->c->x_resolution_time=$new_date;    /*x_resolution_time--------Date/time Field*/
Print ("Date field----------:".$time);
$incident->save();

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!