How to add supplementary item in sales order line automatically using code

Hi,

I have a supplementary item for sales order line.whenever create new line automatically add the supplementary item for current item in sales order line.

Regards,

Have a look at SuppItemCreate* classes.

Hi,
yes,but in that they are temp tables.

You can use the similar approach.
This is what they are doing in those classes,
Calculating the supplementary items related to that order, \Classes\SuppItemCreate\calcSuppItem
and inserting them into a temp table.
Loop the temp table and create sales lines. \Classes\SuppItemCreate\run
\Classes\SuppItemCreate_Sales\createLine

Hi,
Thanks for your reply.
SuppItemCreate::main(Args)
what value is assigning for Args argument.
passed this as value as args SuppItemCalc_Sales but getting errror like “Update must be called with parameter”

try using, mainOnserver.
But this give you prompt. Where you are using this code?

Hi,
While creating line in sales order.

Regards,

You already have the same on sales order line.
Sales order line (button) → Calculate → Supplementary items.

yes…donot want to click this button.whenever new line is created automatically supplementary item is added to
sales order line.

Hi,
yes…ur crt.