main method issue

when i was copying the field values from one table to another by using main method in table thats not working

but same code wrote in under AOT-> jobs node by creating a new job … its working … what is the reason behind that

Something is wrong in your code. But unless you show us the code, it’s impossible to say what’s the problem.

static void Job16(Args _args)

{

Custtable custtable;

DupCust dupCust;

RecordInsertList recordInsertList;

;

recordInsertList = new recordInsertList(tablenum(dupCust));

while select linedisc,Custgroup,invoiceAccount,Telefax,Phone,Address,Name,AccountNum from Custtable where custtable.AccountNum > ‘0’

{

dupCust.AccountNum = custtable.AccountNum;

dupCust.Address = custtable.Address;

dupCust.CustGroup = custtable.CustGroup;

dupCust.InvoiceAccount= custtable.InvoiceAccount;

dupCust.LineDisc = custtable.LineDisc;

dupCust.Name = custtable.Name;

dupCust.Phone = custtable.Phone;

dupCust.TeleFax =custtable.TeleFax;

dupCust.insert();

}

} this one is working but

same code write in under STATIC VOID MAIN(Args _args) method its not working …

Hi,

There is a fundamental issue in your above code.

You are not using ‘RecordInsertList’ class properly. See here for an example - http://msdn.microsoft.com/en-us/library/recordinsertlist.aspx

thank u harish …

but in my project i don’t want to need copy the all values from one table to another only some of the fields … i tried by using just insert method in the traditional way …

but its working on JOBS not working in the main method

How you are running the code in main method? Try debugging the code to find why it doesn’t works .

You should try the set based operation insert_recordset