I try to copy all the Records from a Table named "T1" (say) to a Table named "T2".
Now T1 already existed. I created T2 by copying all the fields from T1. Now when I try copying and pasting T1 records into T2, I get an error "You cannot insert a record from another table".
In the Properties section of the Table T1 & T2, the "PasteIsValid" property is marked YES.
Could you please let me know, what am i doing wrong. I would really appreciate any answer. Thank you.
*This post is locked for comments
Hello,
For this thing you can create a "Processing Only" Report and through code you can copy the records from T1 table to T2 table.
In this report you can assign the T1 fields to T2 table fields and then you can use "tablerec(T2).INSERT;
to copy the records from T1.
According to me this is the best way to do it and it will not effect the performance also.
Hope this will help you :)
Thanks Jon. I think I would agree with you on this. I could have encountered this error because of the code in the Field Triggers. But this was not the case here as T1 did not have any code in any of the Field Triggers. Thanks anyways. Now I can cross out "Field Trigger Code" in the future.
Thanks Vishal. It turns out that I had accidentally (I don't remember when) changed the length of one of the fields in T2.
There must be some difference in fields datatype, length (or may be Key), otherwise it should definitely work.
Use Save as option and create the copy of T1 table as T2 and then check.
if you copied also the code in the triggers, remove the code in table t2, then try again. the error could come from a function in table t2 with paramater of type t1.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156