Skip to main content
Answer

Hiding a Field -- VisibleExpr for Report Designer

  • October 5, 2023
  • 6 replies
  • 585 views

Forum|alt.badge.img

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!

Best answer by hkabiri

@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.

6 replies

hkabiri
Acumatica Moderator
Forum|alt.badge.img+8
  • Acumatica Support Team
  • Answer
  • October 5, 2023

@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.


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • October 5, 2023

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


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • October 5, 2023

@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


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • October 5, 2023

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

?


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • October 5, 2023

@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


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • October 5, 2023

@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!