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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

how to transfer data from our own table to customer table and modify

(0) ShareShare
ReportReport
Posted on by 151

hello,

I have created one table and import data in it with csv file now I want to pass that information to customer table, sales line table and sales header table in such way that if my client code is there then the data is modified or not then data should be inserted as well as if I made some change in my table then it automatically change in others table. I tried some code but data is not modifying in customer table it inserting data only. If I made some change in my table then it not get update in other below is my code.

codeunit 50120 "My table codeunit"

{

    procedure Process()

    var

        mycodeunit: Record "My table";

        customer: Record Customer;

    begin

        InsuranceInterface.Reset();

        customer.Reset();

        repeat

            if not customer.get(mycodeunit."Client Code ") then begin

                customer.Init();

                customer."No." := mycodeunit."Client Code ";

                customer.Address := mycodeunit.Address;

                customer."Address 2" := mycodeunit."Address 2";

                customer.City := mycodeunit.City;

                customer."Post Code" := mycodeunit."Post-Code";

                customer."Phone No." := mycodeunit."Tel. No";

                customer."E-Mail" := mycodeunit."Email Address";

                customer.Insert(true);

            end

            else begin

               

                customer.Name := mycodeunit.Name;

                customer.Address := mycodeunit.Address;

                customer."Address 2" := mycodeunit."Address 2";

                customer.City := mycodeunit.City;

                customer."Post Code" := mycodeunit."Post-Code";

                customer."Phone No." := mycodeunit."Tel. No";

                customer."E-Mail" := mycodeunit."Email Address";

                customer.Modify(true);

            end;

        until

         mycodeunit.Next() = 0;

    end;

}

and code on page is

 action(process)

            {

                Image = Process;

                ApplicationArea = all;

                Promoted = true;

                PromotedCategory = Process;

                PromotedIsBig = true;

                trigger OnAction()

                var

                    mytableProcess: Codeunit "My table codeunit"

                begin

                    mytableProcess.Process();

                    rec."Processed By UserID" := UserId;

                    rec."DateTime Processed" := CurrentDateTime;




                end;

help me regard this if anybody can.

I have the same question (0)
  • Suggested answer
    Alok.kulshreshtha Profile Picture
    934 on at

    Hi Salba,

    Add IF mycodeunit.FINDSET THEN  above to Repeat and try.

    Regards

    Alok Kulshreshtha

    Please Verify my answer if you find my post helpful.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans