Hi all,
I have an XML Business Rule to create TIME_COMMIT associated with a Task. I have a USER_DEF_DTTM that has the start DateTime for the TIME_COMMIT and I need to calculate the end of the day of that DateTime to store it at the end of the TIME_COMMIT (commit_dttm).
The XML that I’m using is the following:
<update_time_commit>
<time_commit>
<task_id>@task_id</task_id>
<start_dttm>@expressionsrequest.user_def_dttm1]</start_dttm>
<!-- This is where I'm having trouble -->
<commit_dttm>@expressionsrequest.user_def_dttm1 + Days(1)]</commit_dttm>
<response_code>PRIMARY</response_code>
<response_type>ARRIVAL</response_type>
<commit_units>DAYS</commit_units>
<commit_interval>@expressions1]</commit_interval>
<calendar_id>24BY7</calendar_id>
<status>ACTIVE</status>
<description>Task SLA based on Planned Start Date - BR</description>
<insert is_initialized="False" />
</time_commit>
</update_time_commit>
This XML always adds Days(1) to the DTTM value, however, this doesn’t give me End of Day, for example, 16/07/2021 10:00AM + Days(1) will result in 17/07/2021 10:00AM and not 17/07/2021 12:00AM. I can’t use a hardcoded add Hours(X) because the DTTM could have different hours, for example 9:00AM, 10:00AM, etc, so the X value won’t always be the same.
I know that Today() always returns the current day at 12AM but I can’t use this since the DTTM also can be in the future.
Does anyone know an alternative on how to achieve this within an XML Business Rule?
Thanks in advance.
Regards,
João Moura