Skip to main content
Answer

Add Attribute(s) to SOLine

  • January 31, 2023
  • 8 replies
  • 229 views

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

I am attempting to add InventoryItem attribute(s) to SOLine

The report I am editing is SO641010.rpx

 

I have added the table InventoryItem with the following join:

SOLine - Left - InventoryItem

SOLine.InventoryID - Equal - InventoryItem.InventoryID

I think this is correct, but have not been able to test it yet.

 

I would like to add the attribute to SOLine, but do not understand the syntax.

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', [SOLine.InventoryID],[SOLine.TranDesc]),[SOLine.TranDesc])

 

How can I properly add attribute(s) with a line break {br} to this syntax?

I found the attribute ID after adding the table and making the relations [InventoryItem.BRAND_Attributes], but not sure how to correctly add it to: =IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', [SOLine.InventoryID],[SOLine.TranDesc]),[SOLine.TranDesc])

 

Thank you for your help

Best answer by nathantrauscht

@BenjaminCrisman

Okay, I looked a another report and got an idea. So to summarize, this was my final solution:

Report SO641010

Add table

SOLine - Left - InventoryItem

SOLine.InventoryID - Equal - InventoryItem.InventoryID

 

Default Line Item Syntax Change

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', [SOLine.InventoryID],[SOLine.TranDesc]),[SOLine.TranDesc])
+iif([InventoryItem.BRAND_Attributes]<> Null,', Brand: '+[InventoryItem.BRAND_Attributes],'')

 

This worked for me!

8 replies

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

Your link is going to be NoteID of InventoryItem to the RefNoteID of the Related Attribute.

please see my last comment on this post about attributes relations.

 


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

Hi @nathantrauscht! I think for this issue you can probably just insert this field into the expression:

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', ([SOLine.InventoryID][InventoryItem.BRAND_Attributes]+,[SOLine.TranDesc]),[SOLine.TranDesc])

I’m not sure where you are looking to show the attribute value in there but you can try to use Concat() also to smash the values together.


nathantrauscht
Semi-Pro II
Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • February 6, 2023

Hi @BenjaminCrisman, I gave this a try but it is giving me an error “Missing operator before the [InventoryItem.BRAND_Attributes] operand.


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

@nathantrauscht it looks like my expression is missing a comma:

But if that doesn’t work you could try to add it in as an extra sequence 

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', ([SOLine.InventoryID],[InventoryItem.BRAND_Attributes],[SOLine.TranDesc]),[SOLine.TranDesc])

 


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • February 14, 2023

Hi @nathantrauscht ,

If you recently configured the attribute on the Inventory Item, you may need to “refresh” the table in the Schema Builder before you will see the new attribute as a choice on the field list in the Report Designer.


nathantrauscht
Semi-Pro II
Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • February 14, 2023

@BenjaminCrisman I tried 

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', ([SOLine.InventoryID],[InventoryItem.BRAND_Attributes]+,[SOLine.TranDesc]),[SOLine.TranDesc])

and

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', ([SOLine.InventoryID],[InventoryItem.BRAND_Attributes],[SOLine.TranDesc]),[SOLine.TranDesc])

 

But they are both giving me a syntax error in the expression

“Syntax error in the expression. Context: TextBox ‘textBox24’ propery ‘Value’”

 

Could it be related to the table relationship setup of 

SOLine - Left - InventoryItem

SOLine.InventoryID - Equal - InventoryItem.InventoryID


nathantrauscht
Semi-Pro II
Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • Answer
  • February 14, 2023

@BenjaminCrisman

Okay, I looked a another report and got an idea. So to summarize, this was my final solution:

Report SO641010

Add table

SOLine - Left - InventoryItem

SOLine.InventoryID - Equal - InventoryItem.InventoryID

 

Default Line Item Syntax Change

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}', [SOLine.InventoryID],[SOLine.TranDesc]),[SOLine.TranDesc])
+iif([InventoryItem.BRAND_Attributes]<> Null,', Brand: '+[InventoryItem.BRAND_Attributes],'')

 

This worked for me!


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

@nathantrauscht That is strange, I tested something similar and it worked for me:

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', [SOLine.InventoryID],[SOLine.LineType],[SOLine.TranDesc]),[SOLine.TranDesc])

When I check your expression though there is an extra bracket:

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', ([SOLine.InventoryID],[InventoryItem.BRAND_Attributes],[SOLine.TranDesc]),[SOLine.TranDesc])

Remove the open bracket from after the {2}’, and it should work

Like this

=IIf([SOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', [SOLine.InventoryID],[InventoryItem.BRAND_Attributes],[SOLine.TranDesc]),[SOLine.TranDesc])