Home

Wednesday, January 15, 2014

Copy Data from one table to another with a given condition in ax

1-Create a table with name CustTableData
2-create two EDT in CustTableData with name Name and AccountNum

3-Write a job for copy data from custtable to your CustTableData with a given condition:-

static void CpyDataFromOneTableToAnother(Args _args)
{
    CustTableData    custTableData  
    CustTable      custTable,custTable1;
    //DictTable   DictTable;
    ;

    while  select * from  custtable where custTable.CountryRegionId == 'India'
    {
        ttsbegin;
        //custTableData    .data(custtable.data());
        custTableData    .AccountNum = custtable.AccountNum;
        custTableData    .Name = custtable.Name;
        custTableData    .DoInsert();
        ttscommit;
        info(custTableData.AccountNum);
     
    }
      info("All Records are inserted successfully");
}

1 comment: