About TRANSFERFIELDS method

Hi,

Can anyone help me with the Transferfields method in Table Fields?

My Problem is when I am trying to transfer the Datas of some fields of one table to the fields of another table with the same Field ID and same Data type, it is not transferred.

I am using like - NEWREC.TRANSFERFIELDS(OLDREC,FALSE);

can anyone please help me and show if any mistakes are made in using?

You are calling the function correctly, so the error can only be that you have differnt properties for the particular fields. Logically I will assume these to be fields that you added. The best solution, is to open the table designer for both tables. Then in the destination table, delete the field, go to the source table, copy the entire field, back to the destination table, and paste it in. This way you are sure that its correct. Obviously check any triggers there that may need to be deleted.

Hi David,

Thank you for the quick reply and help.

I have done the same you told. But it’s still not copying. I think the problem is in my calling of the function. What I want to do is like this -

There is a form which has two Global Variables - OldRec & NewRec. Now, when a Button is pressed, along with some other operations, the operation of the data copying (From OldRec to NewRec) is to be taken place. so, I wrote that line of code previously mentioned [NEWREC.TRANSFERFIELDS(OLDREC,FALSE);] in the OnPush Trigger of the Button.

I am using the method for the 1st time, so, I doubt whether it is the right place (in the OnPush Trigger) to use it or not.

Please help me on this.

Hi,

maybe you miss the NEWREC.INSERT instruction after the transferfields? If so, take care about also to the NEWREC.INIT before insert and the execution of the OnInsert Trigger on destination table putting NEWREC.INSER(TRUE) if you need it.

Ciao

Max

Yes, I forgot to do that!! Thanks very much for your help.

I have copied the datas to the NewRec using the codes - First NewRec.Init, Then Transferfields and lastly NewRec.Insert.

Thank you both again for all the help!!!