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

Create all customers as employes

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

         Can anyone explain me on this create all customers as employees can we do this in AL  and is there any reference for how to create all customers as employess  if anyone knows help me.

Thank you.

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    There are plenty of ways to do this. Do you want it done as a batch job or should it happen every time you create a new customer?

    And just out of curiosity, what is the business case behind this request? Employee is basically just a sub ledger in the same way as a customer is.

  • P V Sarath Profile Picture
    130 on at

    Hi Bruvik,

              Can you tell me the way how to do this I want to apply this through a report when I call the report It should create how many customers I had them to a employee, It is not for a business case just causually  I am trying this.

    Thanks & Regards.

    P V Sarath.

  • Suggested answer
    Amit Baru Profile Picture
    3,037 on at

    hi,

    Pls create one batch job taking Customer table as base dataitem and in that Dataitem write code for creating Employee Master.

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    YUN ZHU Profile Picture
    95,311 Super User 2025 Season 2 on at

    Hi, I personally recommend using Configuration Package, which does not require customization and only needs to collate the same data.

    https://yzhums.com/4286/

    Hope this helps as well.

    Thanks.

    ZHU

  • P V Sarath Profile Picture
    130 on at

    Hi All,

               I have wrote the code in the report for creating all customers as employess but my code is not working can anyone will help me. I am attaching the code of look at it and guide me guys

    trigger OnAfterGetRecord()

               var

                   Customer: Record Customer;

                   Employee: Record Employee;

               begin

                   IF Not Employee.GET(Customer."No.") THEN BEGIN

                       Employee.INIT();

                       Employee."No." := customer."No.";

                       Employee.INSERT();

                   END;

                   Employee."First Name" := Customer.Name;

                   Employee.Address := Customer.Address;

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

                   Employee.City := customer.City;

                   Employee."E-Mail" := customer."E-Mail";

                   Employee.Modify();

               end;

    Thanks & Regards

    P V Sarath.

  • P V Sarath Profile Picture
    130 on at

    Hi All,

               I have wrote the code in the report for creating all customers as employess but my code is not working can anyone will help me. I am attaching the code of look at it and guide me guys

    trigger OnAfterGetRecord()

               var

                   Customer: Record Customer;

                   Employee: Record Employee;

               begin

                   IF Not Employee.GET(Customer."No.") THEN BEGIN

                       Employee.INIT();

                       Employee."No." := customer."No.";

                       Employee.INSERT();

                   END;

                   Employee."First Name" := Customer.Name;

                   Employee.Address := Customer.Address;

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

                   Employee.City := customer.City;

                   Employee."E-Mail" := customer."E-Mail";

                   Employee.Modify();

               end;

    Thanks & Regards

    P V Sarath.

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Also show your report filters if any

  • P V Sarath Profile Picture
    130 on at

    Hi Nitin

              In the proccessinonly Report I am doing this.

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Share complete report code

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,316

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,449 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,431 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans