Skip to main content
deleted 179 characters in body
Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138
JSON.stringify(new Date())

returns

"2013-10-06T15:32:18.605Z"

So when you try passsing it back to apex, its actually trying to convert DateTime into Date and hence you get "FATAL_ERROR System.JSONException: Invalid format: "Tue May 01 00:00:00 GMT 2018" at [line:1, column:10928]

It doesn't make sense to serialize/deserialize data in Javascript. When you can directly bind custom datatypes in components.

However, if you still want to go down that way,

Convert you map public Map<Date, Module_line_item__c> moduleLineItemsMap; to public Map<String, Module_line_item__c> moduleLineItemsMap;

Source: https://stackoverflow.com/a/19210578/4121395

JSON.stringify(new Date())

returns

"2013-10-06T15:32:18.605Z"

So when you try passsing it back to apex, its actually trying to convert DateTime into Date and hence you get "FATAL_ERROR System.JSONException: Invalid format: "Tue May 01 00:00:00 GMT 2018" at [line:1, column:10928]

It doesn't make sense to serialize/deserialize data in Javascript. When you can directly bind custom datatypes in components.

However, if you still want to go down that way,

Convert you map public Map<Date, Module_line_item__c> moduleLineItemsMap; to public Map<String, Module_line_item__c> moduleLineItemsMap;

Source: https://stackoverflow.com/a/19210578/4121395

JSON.stringify(new Date())

returns

"2013-10-06T15:32:18.605Z"

So when you try passsing it back to apex, its actually trying to convert DateTime into Date and hence you get "FATAL_ERROR System.JSONException: Invalid format: "Tue May 01 00:00:00 GMT 2018" at [line:1, column:10928]

Convert you map public Map<Date, Module_line_item__c> moduleLineItemsMap; to public Map<String, Module_line_item__c> moduleLineItemsMap;

Source: https://stackoverflow.com/a/19210578/4121395

Source Link
Pranay Jaiswal
  • 36.4k
  • 17
  • 79
  • 138

JSON.stringify(new Date())

returns

"2013-10-06T15:32:18.605Z"

So when you try passsing it back to apex, its actually trying to convert DateTime into Date and hence you get "FATAL_ERROR System.JSONException: Invalid format: "Tue May 01 00:00:00 GMT 2018" at [line:1, column:10928]

It doesn't make sense to serialize/deserialize data in Javascript. When you can directly bind custom datatypes in components.

However, if you still want to go down that way,

Convert you map public Map<Date, Module_line_item__c> moduleLineItemsMap; to public Map<String, Module_line_item__c> moduleLineItemsMap;

Source: https://stackoverflow.com/a/19210578/4121395