Hai To all ,
i have one temporary table in that i create field in header ( cust account , invoice account , purch id, sales name,sales id ) and in lines ( item number , qty , unit price , proj id ) from here i want to insert values to my main table (sales order) …
here i create class and write coding for insert values from temporary table to my main table ( sales order)…
now i want to insert multiple values from temporary table to my main table ( sales order) … what can i do for that ???
while select HeaderTable
{
NumberSeq = NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().numberSequence);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = HeaderTable.CustAccount;
salesTable.InvoiceAccount = HeaderTable.InvoiceAccount;
salesTable.CurrencyCode = ‘USD’;
salesTable.initFromCustTable();
salesTable.insert();
salesTable.clear();
while select LineTable
{
sl.SalesId=sid;
sl.ItemId = LineTable.ItemId;
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info(“Sales Order Created with Line”);
fl=SalesFormLetter::construct(DocumentStatus::Invoice);
fl.update(SalesTable::find(sid));
info(“Sales Order Posted”);