Solved

Hiding a Field -- VisibleExpr for Report Designer

  • 5 October 2023
  • 6 replies
  • 175 views

Userlevel 5
Badge

Hi all, having an issue. I’m working on a quote design that will amortize the cost of a product over ‘X’ amount of years. Like this --

fields highlighted yellow should not print

However, we only want the calculation to appear for the product and not the separate charges like setup, freight etc. (fields highlighted yellow should not print)

Should the VisibleExpr be something like

=IIf( (InStr( [QuotePricing.TemplateInventoryID], 'APF-PGC')>0, False, True)

Basically, what I’m trying to say is IF InventoryID = ‘APF-PGC’, then don’t print this cell; otherwise, print the cell. The other issue is there are probably have a dozen InventoryIDs where I will have to say if it equals this OR equals this OR equals this etc, then don’t print cell, else go ahead and print.

Using the above, I’m getting a syntax error… help!

icon

Best answer by hkabiri 5 October 2023, 17:45

View original

6 replies

Userlevel 6
Badge +5

@swartzfeger The issue seems to be related to the InStr Formula and value you compare to [QuotePricing.TemplateInventoryID]. Such fields which shows as ID on UI are actually the CD type fields. However, the DAC on the form show you the human readable value which is the InventoryCD. Once these fields are subject to the formula they lose their DAC feature code and the formula would be applied on the real value on the table which is the recordid. That means you either need to find the ID for that item and replace the value on the if condition or relate it to InventoryItem table and put the if condition on InventoryItem.InventoryCD which is the field holds the value you see as Inventory ID on UI.

Userlevel 7
Badge +4

Hi @swartzfeger! In this case the visibility expression is already a kind of IIF() statement, so the IIF part is not necessary.

All you need to do is define the True and False and it should work, as long as there is no results which fall outside the expression

Userlevel 5
Badge

@swartzfegerThe issue seems to be related to the InStr Formula and value you compare to [QuotePricing.TemplateInventoryID]. Such fields which shows as ID on UI are actually the CD type fields. However, the DAC on the form show you the human readable value which is the InventoryCD. Once these fields are subject to the formula they lose their DAC feature code and the formula would be applied on the real value on the table which is the recordid. That means you either need to find the ID for that item and replace the value on the if condition or relate it to InventoryItem table and put the if condition on InventoryItem.InventoryCD which is the field holds the value you see as Inventory ID on UI.

I think I solved!

I realized that there were too many InventoryID exceptions that I needed to make -- and that all the exceptions were of a quantity of 1. So I changed the expression to be based upon the Unit Qty --

=IIf( ([QuotePricing.UserQuantity])<2, False, True)

The above Expr works! :D

Userlevel 5
Badge

Hi @swartzfeger! In this case the visibility expression is already a kind of IIF() statement, so the IIF part is not necessary.

All you need to do is define the True and False and it should work, as long as there is no results which fall outside the expression

Hi Ben, thanks for that because I see what you’re saying and was confused about that.

Are you saying it can simply read

=[QuotePricing.UserQuantity])<2, False, True

?

Userlevel 7
Badge +4

@swartzfeger you don’t need the False/True, the True part is that it is visible, false is just that it is not showing.

So =[QuotePricing.UserQuantity]<2

Userlevel 5
Badge

@swartzfeger you don’t need the False/True, the True part is that it is visible, false is just that it is not showing.

So =[QuotePricing.UserQuantity]<2

Major “duh” moment for me… you’re a saint, benjamin, thanks!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved