Question

Empty Date column has value of 01/01/0001

Hi all,

I have created a process to modify date into a column (Last Action Date). But when this column is empty it has value of 01/01/0001 instead of 0. Which messed another calculation depended on this column. Making the result 700,000 days which is exactly 01/01/2024 minus 01/01/0001.

 

Could anyone please help me with me this?


(Last Action Date with Empty Value causing conflick result in another calculation.)


(I used to make dialog box to check whether my calculation is correct so we suspect it might relate to to this.)

Like 1

Like

2 comments
Best reply

Hello!

 

"Date/Time", "Date" and "Time" data types in Creatio objects are represented in C# as "DateTime" struct. This struct's value defaults to "1/1/0001 12:00:00 AM" (reflected in "DateTime.MinValue" property of struct).


When you are working with columns in business-process designer in Creatio you are literally working with C#. That's why you can use formula (which is C# one-line code) in most of places where you work with columns or parameters in business-processes. Check https://academy.creatio.com/docs/8.x/no-code-customization/bpm-tools/business-process-setup/process-formulas for more details.


I guess all you need to do is add condition in your calculations that replaces value with 0 if column is empty. It could be something like "if [YourCoumnResult] == DateTime.MinValue ? 0 : [YourCoumnResult]" in your calculations (ternary conditional operator for one-line code). This is just an example, I don't know how you calculate so can't provide related example.

If you can send screenshot of your calculation or describe more precisely how you do it I can help with realizing condition.

Hello!

 

"Date/Time", "Date" and "Time" data types in Creatio objects are represented in C# as "DateTime" struct. This struct's value defaults to "1/1/0001 12:00:00 AM" (reflected in "DateTime.MinValue" property of struct).


When you are working with columns in business-process designer in Creatio you are literally working with C#. That's why you can use formula (which is C# one-line code) in most of places where you work with columns or parameters in business-processes. Check https://academy.creatio.com/docs/8.x/no-code-customization/bpm-tools/business-process-setup/process-formulas for more details.


I guess all you need to do is add condition in your calculations that replaces value with 0 if column is empty. It could be something like "if [YourCoumnResult] == DateTime.MinValue ? 0 : [YourCoumnResult]" in your calculations (ternary conditional operator for one-line code). This is just an example, I don't know how you calculate so can't provide related example.

If you can send screenshot of your calculation or describe more precisely how you do it I can help with realizing condition.

Khassan Khakak,


Hi, thanks for your reply, I resolved the issue by applying the solution that you provided!

 

Good day.

Show all comments