By using this website, you agree to our Terms of Use (click here)
Hi all, i'm running into an issue with an iif calc on my report.. please see error and code below...
I have tried all of the following and can't figure it out:ย
=IIf([JPMBillingRule.JPMBillTypeID] = 'Fixed Price', $Var1, $Var2)
=IIf([JPMBillingRule.JPMBillTypeID] = 'Fixed Price', CStr($Var1), CStr($Var2))
part of the long error message i receive says:ย
PX.Reports.Parser.ExpressionException: Cant calculate expression node: 'groupHeaderSection1 (PX.Reports.Data.GroupSectionNode) dataItem: System.Object[]'. --->
PX.Reports.Parser.ExpressionException: Cant calculate expression part: 'IIf(UnaryOp:ย ย (BinaryOp = (Identifier(JPMBillingRule.JPMBillTypeID), Const(Fixed Price))),
PX.Reports.Parser.FunctionNode, PX.Reports.Parser.FunctionNode)'. --->
PX.Reports.Parser.ExpressionException: Cannot perform '=' operation on System.Int32 and System.String.ย
does anyone see any glaring errors or have some troubleshooting tips??ย ย many thanks!!
Hi Emma,
I think the issue here is that JPMBillingRule.JPMBillTypeID is actually a integer (System.Int32) whereas Fixed Price is a string (System.String).
This is a good example of why it's good to be aware that you are actually building reports on Data Access Classes, not database tables directly. This was my first experience realizing this:
https://www.augforums.com/lesson-learned-dont-abandon-the-acumatica-data-access-classes-dac/
JPMBillingRule.JPMBillTypeID might get displayed on the screen as Fixed Price, but it's likely stored in the database as an integer. So when you try to do a calculation like a comparison, you get an error.
Awesome!!ย Thank you so much; I checked out the post that you linked and looked up correct DAC and added it to the schema and the correct field onto the report!! That definitely worked!!! Appreciate it ๐ย
Sweet! Glad it worked out.
Also, just in case you don't already know about Inspect Element, check this out:
https://www.augforums.com/inspect-element-best-friend/
