Skip to main content

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(fSOLine.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 nInventoryItem.BRAND_Attributes], but not sure how to correctly add it to: =IIf(=SOLine.InventoryID]<>Null, Format( '{0}: {1}', 1SOLine.InventoryID],ySOLine.TranDesc]),sSOLine.TranDesc])

 

Thank you for your help

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.

 


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.


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


@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(ISOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', ('SOLine.InventoryID],IInventoryItem.BRAND_Attributes],eSOLine.TranDesc]),cSOLine.TranDesc])

 


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.


@BenjaminCrisman I tried 

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

and

=IIf(fSOLine.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


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


@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(ISOLine.InventoryID]<>Null, Format( '{0}: {1}: {2}', 'SOLine.InventoryID],DInventoryItem.BRAND_Attributes],sSOLine.TranDesc]),]SOLine.TranDesc])


Reply