web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Modify Data from Source table to destination table after inserting

(0) ShareShare
ReportReport
Posted on by 25

I created Source table and destination table . 

1. Inserted records from source to destination using insert in codeunit 

2.Now I changed Records in source Table I want to update the same using codeunit help me

I am getting this error:

The Insert Modify Task destination already exists. Identification fields and values: No.='101'
---------------------------
OK
---------------------------

I have the same question (0)
  • Lars Lohndorf-Larsen Profile Picture
    Microsoft Employee on at

    Hello,

    You can either empty the destination table every time (DELETEALL;), and then re-insert every record from the source table. If you only want to update existing records in the destination table, then TRANSFERFIELDS and MODIFY should do it, like this, assuming that source and destination table definitions are identical:

    DestinationTable.GET(SourceTable.PrimaryKey);

    DestinationTable.TRANSFERFIELDS(SourceTable);

    DestinationTable.MODIFY;

    I hope you can use that?

  • Suggested answer
    YUN ZHU Profile Picture
    102,123 Super User 2026 Season 1 on at

    Hi, It seems that the record already exists when you insert it again, please check before insert.
    for example

    if destination.get(PrimaryKey) then
     exit;

    Hope this will help.

    Thanks.

    ZHU

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,496 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 961 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 870 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans