1 Reply Latest reply on Sep 29, 2016 7:13 AM by florian1

    How to easily administer HOP exceptions?

    p.neuteboom Rookie

      Hi community,

       

      Does anyone know how to easily enter and maintain public holidays like easter, pentecost or any other reoccuring regional holiday? Each year I need to enter the exceptions and since we maintain multiple HOPs, this is a cumbersome task. To my knowledge there is no way to automate this task or a way to upload them based on (for example) Excel sheet of some sort?

       

      Any help is help appreciated!

        • 1. Re: How to easily administer HOP exceptions?
          florian1 Expert

          Hi Patrick,

           

          As far as I know there is no easy (drag & drop) way out of the box.

          I would really appreciate HEAT providing us an easy way to do this. It shouldn't be that complicated for their programmers.

           

          With a certain amount of work everything is surely doable.

          You will only need some programming skills and knowledge of JSON to be able to utilize the SOAP API for this.

           

          1) Get all the public holidays for a specific country/state (I prefer Enrico Service) and store the results in a poco object.

          2) Get all the current exceptions in HEAT for your specific HOP.

          3) Merge 2) and 1) into a single object.

          4) Serialize 3) as JSON (NewtonSoft.JsonConvert) and use UpdateObject() to update your HOP.

          Et voilà! :-)

           

          * for 2):

          Request:

          <soapenv:Envelope xmlns:soapenv="
          http://schemas.xmlsoap.org/soap/envelope/
          " xmlns:saas="SaaS.Services">
          
             <soapenv:Header/>
             <soapenv:Body>
                <saas:Search>
                   <saas:sessionKey>~yourSessionKey~</saas:sessionKey>
                   <saas:tenantId>~yourTenant~</saas:tenantId>
                   <saas:ObjectQuery>
                      <saas:From Object="frs_def_hours_of_operation#">
                      </saas:From>
                      <saas:Select All="false">
                         <saas:Fields>
                            <saas:Field Name="Definition"/>
                            <saas:Field Name="Name"/>
                         </saas:Fields>
                      </saas:Select>
                   </saas:ObjectQuery>
                </saas:Search>
             </soapenv:Body>
          </soapenv:Envelope>
          
          

          Response:

          [...]
                                  <WebServiceFieldValue>
                                     <Name>Definition</Name>
                                     <Value xsi:type="xsd:string">{"Id":"043989AAE82A42129CF725CE742EC4DB","Name":"24 x 7","TimeZoneId":"PST8PDT","Schedules":[{"Name":"24 x 7","Open":true,"RecurringEvent":{"DTStart":new Date(0),"DTEnd":new Date(86400000),"RRule":{"Frequency":"Daily","Until":null,"Count":null,"Interval":1,"ByHour":null,"ByDay":null,"ByMonthDay":null,"ByYearDay":null,"ByWeekNo":null,"ByMonth":null,"BySetPos":null,"Wkst":"Monday"}},"SingleEvents":null,"Calendar":null}]}</Value>
                                  </WebServiceFieldValue>
          [...]
          
          

           

          Have a closer look at the "Definition" value.

          These are the HOPs stored in JSON.

           

           

          Cheers,

          Florian

          2 of 2 people found this helpful