Unable to insert a new amWorkCalendar record with more than one day.

  • KM03060525
  • 21-Dec-2017
  • 21-Dec-2017

This document has not been formally reviewed for accuracy and is provided "as is" for your convenience.

Summary

Error during creation of records in amWorkCalendar table.

Question

One activity I need to perform, is to create new record in HPAM amWorkCalendar table, thru the use of the HPAM web service.
A simple POST on url https://web.com/AssetManagerWebService/rs/db/amWorkCalendar with a JSON like this:
{"field_Nom":"815-30514-02","field_Type":"MC-FLM","lParentId":"86558405","lfield_LocationWoCalendarId":"974742","memDays":"sunday=08:00-24:00"}
Works fine.
As soon as we try adding more days, it does NOT work. Clearly, there is a special caracter required to be passed OR we need another JSON structure to achieve this.

Answer

Customer was trying to add records in the amWorkCalendar table, but received the following error message:
Error reading the line 'sunday= saturday= friday= thursday=08:00-21:00 wednesday= tuesday=08:00-21:00 monday=08:00-21:00'
In order to separate days, they need to add: '+CHAR(13)+CHAR(10)+' to split days.
Example:
{"SQLName":"JDTEST5","Name":"JDTEST5","memDays":"sunday=08:00-17:00 '+CHAR(13)+CHAR(10)+'saturday= '+CHAR(13)+CHAR(10)+'friday=08:00-14:00 '+CHAR(13)+CHAR(10)+'thursday= '+CHAR(13)+CHAR(10)+'wednesday= '+CHAR(13)+CHAR(10)+'tuesday= '+CHAR(13)+CHAR(10)+'monday= "}