Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Error : You cannot insert a record from another table

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error : You cannot insert a record from another table

    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 :)  

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error : You cannot insert a record from another table

    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.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error : You cannot insert a record from another table

    Thanks Vishal. It turns out that I had accidentally (I don't remember when) changed the length of one of the fields in T2.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error : You cannot insert a record from another table

    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.

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Error : You cannot insert a record from another table

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans