What is the Method/Code that puts ItemGroup in Sales Order Line

Im testing some code to use for inserting Sales Order Lines

but my code does not automatically put the Item Group (It shows in manual adding)

can i know what code/method used to put the Item Group Financial Dimension of the Sales Order Line?

my code for testing (1 item only):


SalesLine.SalesId = SalesTable.SalesId;
SalesLine.ItemId = ‘100407’;
SalesLine.SalesQty = 5;


SalesLine.InventDimId = InventDim::findOrCreate(inventDim).inventDimId;



what should i add to get the ItemGroup?

help. thanks.

the standard does the update of default dimension from item in, \Classes\SalesLineType\initFromInventTable

hello, where should i put the code?

i tried:


and put it after createLine, but it didnt work.

you can place it before createLine. If you don’t want other functionality from initFromInventTable, only take the defaultDimenson update code(from \Classes\SalesLineType\initFromInventTable) and use it in your code before createLine call.