Skip to main content
Solved

Visible Expression validation issue

  • November 11, 2024
  • 7 replies
  • 89 views

Forum|alt.badge.img

All, I’m having trouble validating the syntax of this visible expression… I’ve looked at it so many times now I think I’m going blind.

 

=iif(([AMProdOper.Descr]='Stage 2' and (Right([AMProdItem.InventoryID],4)='-PGC', True, False)))

 

So I want the text box to display if:

the production stage description is ‘Stage 2’ and

If the InventoryID ends in ‘-PGC’

I’m not sure if it’s the closing parens or if my expression to pull the correct Inventory IDs is at fault… thanks!

Best answer by miguel80

Hi!

 

I think the parenthesis are wrong. Try this:

=iif([AMProdOper.Descr]='Load roll of film for job' and Right([InventoryItem.InventoryCD],1)='C', True, False)

 

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

7 replies

dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • 648 replies
  • November 11, 2024

Try this 

=iif(([AMProdOper.Descr]='Stage 2' and (Right([AMProdItem.InventoryID],4)))='-PGC', True, False)


Forum|alt.badge.img
  • Author
  • Freshman II
  • 180 replies
  • November 11, 2024
dcomerford wrote:

Try this 

=iif(([AMProdOper.Descr]='Stage 2' and (Right([AMProdItem.InventoryID],4)))='-PGC', True, False)

Thanks Dermot, that validates but when I try to load the Production Ticket report I receive an error. I’m going to have to dig deeper into this...


miguel80
Semi-Pro II
Forum|alt.badge.img+1
  • Semi-Pro II
  • 71 replies
  • November 12, 2024

Hi!

 

I believe that the InventoryID is a number and is not what you see in the screen. Try joining the InventoryItem table so that you can use the InventoryCD field, which is the text you need.

 


dcomerford
Captain II
Forum|alt.badge.img+15
  • Captain II
  • 648 replies
  • November 12, 2024

@swartzfeger agree with @miguel80 good spot InventoryID will be an int value


Forum|alt.badge.img
  • Author
  • Freshman II
  • 180 replies
  • November 12, 2024
miguel80 wrote:

Hi!

 

I believe that the InventoryID is a number and is not what you see in the screen. Try joining the InventoryItem table so that you can use the InventoryCD field, which is the text you need.

 

 

Thanks Miguel, you are right! I always forget about the ID vs CD. The report already had this join:

AMProdItem left InventoryItem, InventoryID = InventoryItem.InventoryID

I changed the expression to [InventoryItem.InventoryCD]

=iif(([AMProdOper.Descr]='Load roll of film for job' and (Right([InventoryItem.InventoryCD],1)))='C', True, False)

But it still throws this error in the stack trace

  • Input string was not in a correct format.
  • String was not recognized as a valid Boolean.
  • Cannot convert the value 'C' to the type
  • Cannot perform the '=' operation on System.Boolean and System.String.

 


miguel80
Semi-Pro II
Forum|alt.badge.img+1
  • Semi-Pro II
  • 71 replies
  • Answer
  • November 12, 2024

Hi!

 

I think the parenthesis are wrong. Try this:

=iif([AMProdOper.Descr]='Load roll of film for job' and Right([InventoryItem.InventoryCD],1)='C', True, False)

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 180 replies
  • November 12, 2024
miguel80 wrote:

Hi!

 

I think the parenthesis are wrong. Try this:

=iif([AMProdOper.Descr]='Load roll of film for job' and Right([InventoryItem.InventoryCD],1)='C', True, False)

 

You, sir, are a genius… thank you, Miguel!


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