Skip to content

Commit c65b66c

Browse files
committed
Added DateTime data type support in writeFields
DateTime data type was missing. Addition of formatDateTime in RemoteTK.component helps ensure proper format is passed.
1 parent 69b581e commit c65b66c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

RemoteTKController.cls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public class RemoteTKController {
6464

6565
if (valueType == Schema.DisplayType.Date) {
6666
obj.put(key, Date.valueOf(svalue));
67+
} else if (valueType == Schema.DisplayType.DateTime) {
68+
// per apex docs: the specified string should use the standard date format “yyyy-MM-dd HH:mm:ss” in the local time zone.
69+
obj.put(key, DateTime.valueOf(svalue));
6770
} else if (valueType == Schema.DisplayType.Percent ||
6871
valueType == Schema.DisplayType.Currency) {
6972
obj.put(key, svalue == '' ? null : Decimal.valueOf(svalue));
@@ -291,4 +294,4 @@ public class RemoteTKController {
291294

292295
return JSON.serialize(result);
293296
}
294-
}
297+
}

0 commit comments

Comments
 (0)