In multiple projects with Siebel CRM, the need arises to take into account business days and holidays depending on the geographical area, the client’s work schedule when we add X days in a date type field to meet the client’s requirements or simply by legal obligation such as service requests or trouble tickets.
After searching, the best way to achieve the objective and trying to reduce the use of eScript as much as possible, in this post I present the easiest and most elegant way that is also manageable by the client.

The key is in a business service “FS Holiday API Service” and its GetResponseTime method.
We can invoke the method either with the help of the eScript (it would be the only code we would need) or using a calculated field using the InvokeServiceMethod function passing all the parameters that I will detail below.
The required parameters are the following:
– Start Time – initial date to which we want to add the days (you can also add hours)
– Response Time – the time we want to add in days, hours, etc.
– Time Zone – the geographical area to take into account (ex: GMT-05:00 Bogota, Lima, Quito)
– Priority – always 1
– ServiceCalendarId – the row_id of the work calendar that we want to use (I will detail its creation in another post)
– Time Unit – Days (you can also use any other time unit, always taking into account the language we use in the application)
– Committed Time – is the output parameter of the method that contains the calculated date.
To create a work calendar we have to go to the Site Map application –> Service Administration –> Schedules.
We will create a new schedule whose Row Id we have to pass in the ServiceCalendarId parameter of the method indicated above.
In the second part I will explain how to create a work calendar and the associated holidays.


