Skip to main content
Solved

Need help with an IF statement in GI

  • 16 December 2022
  • 5 replies
  • 875 views

Forum|alt.badge.img

Hi,

 

Trying to build out a GI and needing some help on an IF statement.

 

Here’s the scenario. 

 

If the Lot/Serial class is ‘LOTTED’, then the Lot/Serial Nbr. column should be ‘green’ for ‘LOTTED’ items where it is not empty and ‘red’ for ‘LOTTED’ items that are empty. If it is not LOTTED, then it should be ‘default’.

 

If the Lot/Serial Class is ‘DEFAULT’, the QTY Remaining column should be ‘green’ if QTY Remaining > QTY on Hand and should be ‘red’ if QTY Remaining < QTY on Hand. If it is LOTTED, then it should be ‘default’ in this column.

 

Here are my existing formulas in the respective fields:

QTY Remaining:

=IIf( [AMProdMatl.QtyReq] > [INSiteStatusSummary.QtyOnHand], 'bad', 'good' )

 

Lot/Serial Nbr:

=IIf([AMProdItem.LotSerialNbr]= Null,'bad', 'good' )

 

 

 

Best answer by brendan91

@jwarren 

This should do it. You just turn the “else” into a second if statement which I think is what everyone else is saying. 

Replace the field captions with the actual field mapping and this should work fine.

Lot/Serial Class Color = iif([Lot/Serial Class] = ‘LOTTED’, ‘default’, iif([QTY Remaining] > [Qty on Hand], ‘good’, ‘bad’))

 

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

5 replies

BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 631 replies
  • December 16, 2022

Hi @jwarren! Have you already tried using just ‘’ instead of null?

So like =IIf([AMProdItem.LotSerialNbr]= ‘’,'bad', 'good' )


Forum|alt.badge.img
  • Author
  • Varsity II
  • 109 replies
  • December 16, 2022
BenjaminCrisman wrote:

Hi @jwarren! Have you already tried using just ‘’ instead of null?

So like =IIf([AMProdItem.LotSerialNbr]= ‘’,'bad', 'good' )

The IF statements themselves are working - what I’m trying to do is for lines 3 and lines 4 in my screenshot, since these are Lot Class = DEFAULT, there should be no style (neither green or red) it should be the default style in Lot/Serial column. Vice versa for lines 1 and 2 - there should be no style in the QTY remaining column when it is LOTTED Class.


DConcannon
Varsity II
Forum|alt.badge.img+2
  • Varsity II
  • 119 replies
  • December 17, 2022

@jwarrenCan you post the GI XML? You’re going to need nested IIfs for both fields, if I am reading your posts correctly.


Forum|alt.badge.img
  • Author
  • Varsity II
  • 109 replies
  • December 19, 2022
DConcannon wrote:

@jwarrenCan you post the GI XML? You’re going to need nested IIfs for both fields, if I am reading your posts correctly.

I believe you are correct. Here is an export of the results grid for the GI. 


brendan91
Semi-Pro III
Forum|alt.badge.img+1
  • Semi-Pro III
  • 92 replies
  • Answer
  • December 19, 2022

@jwarren 

This should do it. You just turn the “else” into a second if statement which I think is what everyone else is saying. 

Replace the field captions with the actual field mapping and this should work fine.

Lot/Serial Class Color = iif([Lot/Serial Class] = ‘LOTTED’, ‘default’, iif([QTY Remaining] > [Qty on Hand], ‘good’, ‘bad’))

 


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