How to copy record from one table to another table ??

Hi,

I have two table suppose TableA and TableB. both tables having their own fields, Now I want to Copy data from one table to another, both tables fields data types are same but name are different and I want to Copy one by one record from TableA to TableB, How can I do That.

Table A TableB

Id Marks Passing date Roll No Marks Resultdate

101 85 5/12/2014 101 85 5/12/2014

102 70 5/25/2014 102 70 5/25/2014

So how can I copy data from Table A if I want same data in TableB

tableA a; tableB b; ttsBegin; // Clear the data from the copy table delete_from b; while select * a { // tableB.init(); // tableB=tableA. // tableB.save(); buf2Buf(a, b); b.insert(); } ttsCommit;

sorry please ignore my solution i think i didn’t read question correctly

Just one of many possible solutions:

while select tableA
{
    tableB.clear();
    tableB.RollNo = tableA.Id;
    tableB.Marks = tableB.Marks;
    tableB.insert();
}

Insert_recordset would be much more efficient, but you first have to learn the basics.

Reading the documentation, training materials or a book about AX programming would help you to start.