Skip to main content
Solved

Share a way to Calculate datetime intervals in GI style comlumn/Row style.

  • 17 October 2023
  • 1 reply
  • 58 views

Forum|alt.badge.img+5
  • Captain II
  • 398 replies

Hello,

       Still in 2021R2, I don’t know if latest version still having this issue.

The datatime manipulating functions like DateDiff( 'd', [DateFrom],[DateTo]) can work perfectly when put in data field like below. But when you put it in styles, it would run with error “mismatch type”

 

      It probably due to Acumatica did not handle it in style columns.
Luckily, we can handle this ourself.  Like below:
(DateDiff( 'd', CDate( Replace( [DateFrom],' 12:00:00 AM', '') ),CDate( Replace( [DateTo],' 12:00:00 AM', '') ))
   
 Firstly, you have to replace the ' 12:00:00 AM' with empty, note, a space is in front of 12:00:00
   
Secondly, you use Cdate to forcely convert the type.
Then, you can use Datediff function as usual, no errors anymore.

Best answer by dwijebandara26

Hi, 

You can set the Style as follows. 

=IIf( CRCase_FormulaF2D60756C7BA49F9BF962979F0EC527D<1, 'red', 'green' )

 

 when you have a formula in the data field GI will have the field name like CRCase_FormulaF2D60756C7BA49F9BF962979F0EC527D.

you can get the field name from the following GI shared by @darylbowman

Referencing GI formula results for styles or other reasons | Community (acumatica.com)

 

Thanks

Desh

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img
  • Jr Varsity III
  • 25 replies
  • Answer
  • September 25, 2024

Hi, 

You can set the Style as follows. 

=IIf( CRCase_FormulaF2D60756C7BA49F9BF962979F0EC527D<1, 'red', 'green' )

 

 when you have a formula in the data field GI will have the field name like CRCase_FormulaF2D60756C7BA49F9BF962979F0EC527D.

you can get the field name from the following GI shared by @darylbowman

Referencing GI formula results for styles or other reasons | Community (acumatica.com)

 

Thanks

Desh


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings