Skip to main content
Answer

Quick question about visible expression

  • January 20, 2023
  • 13 replies
  • 499 views

Forum|alt.badge.img+1

Hello,

What can I write in the visible expression for this ‘SN’ + [SOShipline.LotSerialNbr] to NOT display if [SOShipline.LotSerialNbr]=NULL. Thanks a lot!

I’ve tried these:

=[SOShipLine.LotSerialNbr]<>Null

IIf( [SOShipLine.LotSerialNbr]=Null, '', [SOShipLine.LotSerialNbr] )

=IIf( [SOShipLine.LotSerialNbr]<>null, [SOShipLine.LotSerialNbr], '' )

 

Edit: This works but not when I need the ‘SN: ‘ before [SOShipLine.LotSerialNbr]

=IIf([SOShipLine.LotSerialNbr]<>null,[SOShipLine.LotSerialNbr],'')

Trying this,

=IIf([SOShipLine.LotSerialNbr]<>null,('SN: ' + [SOShipLine.LotSerialNbr]),'')

Results to this:

Any help please, thank you!

Best answer by aaghaei

@paula012 null value comparison requires special syntax. Try 

=IIf(IsNull([SOShipLine.LotSerialNbr], '')<>’’,‘SN: ‘ + [SOShipLine.LotSerialNbr],'')

13 replies

Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Sorry I mean, I’m putting this in the Value field, not in the visible expression.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Oh, or could it be because in this list, I have an item that HAS serial number, which is already true, and so it would give my SN value and disregard the fact the next items are false? Is this correct, anyone? Thanks!

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • Answer
  • January 20, 2023

@paula012 null value comparison requires special syntax. Try 

=IIf(IsNull([SOShipLine.LotSerialNbr], '')<>’’,‘SN: ‘ + [SOShipLine.LotSerialNbr],'')


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

@paula012 null value comparison requires special syntax. Try 

=IIf(IsNull([SOShipLine.LotSerialNbr], '')<>’’,‘SN: ‘ + [SOShipLine.LotSerialNbr],'')

Thank you, but it resulted to error.

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • January 20, 2023

I was typing on iPhone. The issue could be single quotations. Use your laptop keyboard to replace them and should work


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Thanks again, now it does

But why is the {Br} not working, this is my formula now sir

=IIf(IsNull([SOShipLine.LotSerialNbr], [SOShipLine.TranDesc])<>’’, [SOShipLine.TranDesc] + '{Br}' + 'SN: ' + [SOShipLine.LotSerialNbr], [SOShipLine.TranDesc])

I also tried without closing {Br} with ‘’


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Oh nevermind, I got it. Thank you so much sir @aaghaei , such a huge help!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • January 20, 2023

Please copy your final formula here for people reference in case they come across the same issue. Thanks 


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Please copy your final formula here for people reference in case they come across the same issue. Thanks 

=IIf(IsNull([SOShipLine.LotSerialNbr], [SOShipLine.TranDesc])<>’’, [SOShipLine.TranDesc] +'{br}'+ 'SN: ' + [SOShipLine.LotSerialNbr], [SOShipLine.TranDesc])

 

Thanks a lot sir!


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Sir @aaghaei , one more related question please.

So this is now the source of my Serial#s- SOShiplineSplit, they’re listed on Line Details in acumatica, wherein ONE Item has many serial #s. Is it possible for me to display that Item once, then followed with the multiple serial#s? Thank you again!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • January 20, 2023

Sorry this is not my area of expertise so I do not want to give you a misleading answer.
 

What I can say if you have an inventory item that serials are the child of it (serials are entered as records on a child table) then you can add a sub-report to your main report that will grow based on the number of serial #s. 
 

If the serials are entered in front of item description (all in one text field and speared with a unique character )  to some degree using mix of InStr and Substring functions you can find the start position of serials and use line break to print them under each other.

 

both of scenarios need a little bit of work to get them work but both are doable.


Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • January 20, 2023

Oh, I know this may be easy to you, but as I’m not yet very understanding of subreports, and even more, of using InStr and SubString, I think I need to comprehend this first and make a follow up question. But I need it fast, perhaps.. can you consider this instead? Is it possible that I can insert a condition that if [SOShipLine.TranDesc] already EXISTS, then that should not display? I got this formula from someone here, do you think I can make use of it somewhere in my existing formula?

IIf(Prev([SOShipLine.TranDesc])=[SOShipLine.TranDesc], '', [],[SOShipLine.TranDesc]

 

Again, thank you so much!


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • January 20, 2023

It might. Please create a new thread with proper topic and attach your report template that community people can have a look. If you tag me I will try to have look too within my time constraints.