Skip to main content
Answer

Adding Lot/Serial Number to AR Invoice AR641000 using IIF()

  • April 17, 2023
  • 2 replies
  • 328 views

nathantrauscht
Semi-Pro II
Forum|alt.badge.img

I would like to add the Lot/Serial Number to AR Invoice AR641000 using an IIF()

Reason for using the IIF() is because I want to add a line break and ‘Serial Number: ‘ only if the the line item has a Lot/Serial Number. But it’s showing the (False) value regardless of if the item has a serial number allocated or not.

iif([ARTran.LotSerialNbr]=null, '', '{br}' + 'Serial Number: '+[ARTran.LotSerialNbr])

 

I’m not sure what is the problem. It’s like it thinks the line has a serial number even when it does not.

I am pretty sure the [ARTran.LotSerialNbr] is correct because when testing it added the correct serial number.

 

Any ideas?

Best answer by kdavis45

Acumatica typically treats these fields as blank, rather than null - it’s an important distinction for these types of formulas.

  • Iif([ARTran.LotSerialNbr]=’’,’’,’{br}’ + ‘Serial Number: ‘ + [ARTran.LotSerialNbr])

If/when I’m unsure, I err on the side of caution and include both.

  • Iif(([ARTran.LotSerialNbr]=’’ or [ARTran.LotSerialNbr]=null),’’,’{br}’ + ‘Serial Number: ‘ + [ARTran.LotSerialNbr])

2 replies

kdavis45
Semi-Pro I
Forum|alt.badge.img+1
  • Semi-Pro I
  • Answer
  • April 17, 2023

Acumatica typically treats these fields as blank, rather than null - it’s an important distinction for these types of formulas.

  • Iif([ARTran.LotSerialNbr]=’’,’’,’{br}’ + ‘Serial Number: ‘ + [ARTran.LotSerialNbr])

If/when I’m unsure, I err on the side of caution and include both.

  • Iif(([ARTran.LotSerialNbr]=’’ or [ARTran.LotSerialNbr]=null),’’,’{br}’ + ‘Serial Number: ‘ + [ARTran.LotSerialNbr])

nathantrauscht
Semi-Pro II
Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • April 17, 2023

@kdavis45 that worked, thank you!