Add negative number to AddHours in formula of a business rule

Hi,

I want to set a field value so that it is 1 hour BEFORE the start time field. Trying to do this via business rule but it's not letting me write a negative number (-1).

Any ideas how to do this?

Thanks,

Chani

Like 0

Like

6 comments

I did this with days but should work with hours and a date/time field.

 

[#System variable.Current Date#].AddDays(-7)

 

Updated via business process

Thank you. We rather not create a business process for such a thing. Looking for a way to do it via business rule. 

Chani Karel,

Hello,

This method can only be implemented through a business process using C# with the ".AddHours(-1)" method.

https://learn.microsoft.com/en-us/dotnet/api/system.datetime.addhours?view=net-8.0



Best regards, 

Orkhan

Create another date/time field and use the set field value in the business rule with the AddHour(-1) formula. That date field will then be one hour behind start time field

Rob Watson

There is no way to do AddHour(-1) in the formula.

Orkhan,

:(

Thanks for confirming 

Show all comments