Solved

Add Attribute(s) to SOLine

  • 31 January 2023
  • 8 replies
  • 167 views

Userlevel 5
Badge +1

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

icon

Best answer by nathantrauscht 14 February 2023, 23:25

View original

8 replies

Userlevel 7
Badge +8

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.

 

Userlevel 7
Badge +4

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.

Userlevel 5
Badge +1

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

Userlevel 7
Badge +4

@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])

 

Userlevel 7
Badge +7

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.

Userlevel 5
Badge +1

@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

Userlevel 5
Badge +1

@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!

Userlevel 7
Badge +4

@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])

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved