Skip to main content

Hello,

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

The datatime manipulating functions like DateDiff( 'd', DateFrom],FDateTo]) 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( DDateFrom],' 12:00:00 AM', '') ),CDate( Replace( DDateTo],' 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.

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