Overview
Contains a function that can be used when sending data in JSON format e.g. storing or updating data in a database using Web API to convert date formats. This listing contains the modifyjsondata() function and instructions on how to use the function. Works with any format of Date / Date Time conversion, given that the provided date / date time format as an input to this plug-in is correct as per the JSON. It can also modify list of Date attributes of the JSONObject / JSONArray at a time (e.g. createdOn (Date), modifiedOn (Date)), instead of doing it one after the another.
NOTES:
Hi Alok - i've discovered a bug in this plug-in. When a JSON string has its date updated and the date happens to be the last field in the CDT / Dictionary, the returned JSON string accidentally omits the final "]" and "}" characters. It seems to only happen when the updated property is the last one in the cdt/dictionary, i.e. in my tests if I add an extra field after, the problem disappears.
For example here's a test dictionary with date fields for "created" and "modified". When i just update "created", the output is correct as I expect:
However when i update "modified", since it's the last field, it omits the last 2 closing characters:
This is causing us some pretty weird and severe issues in our project where we're using this plug-in, as certain things are randomly failing when the JSON text is re-loaded.
Hi Mike, Apologies for the delay in my response, as I was on a vacation, and apologies for the problem caused in your project due to this plug-in. Also thanks for your input. I will try to upload a new version of this plug-in shortly (probably by this weekend). Once again thanks for identifying this issue. Thanks!
Hi Alok,
Since you've changed companies and have a new account (aloks0001 vs aloks176) you were unable to submit a new version of this plug-in. I've updated the security on the plug-in so that you submit a new version. Thanks for your contribution!