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

Importing the Vendors

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

          I am Exporting the vendors table and importing it in the Employee table, but I am getting some issues in importing the vendors, In my Employee table there is data of No.'s 10000 so these numbers are not creating again in my Employee table,

I am sharing my code please anyone guide me.

local Procedure InsertFileinEmployee()
    var
        Employee: Record Employee;
        Instr: InStream;
        FileName: Text;
    begin
        Clear(Employee);
        UploadIntoStream('', '', '', FileName, Instr);
        Xmlport.Import(Xmlport::"Employee Imports", Instr);
        Message('Import Done successfully.');
    end
I am calling thi function in my codeunit runtrigger, 
 action(ImportVendors)
            {
                ApplicationArea = All;
                Caption = 'Import Vendors';
                ToolTip = 'Vendors the Selected Employees';
               
                trigger OnAction()
                var
                InsertVendor: Codeunit "Update Employees";
                EmployeeInsert: XmlPort "Employee Imports";
                begin
                    InsertVendor.Run();
                end;
The Error I got is 
pastedimage1663651662186v3.png
I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Your Employee No. field's value is same with Vendor No.'s value you need make them unique while importing.

  • Suggested answer
    Shathika Karunaratne Profile Picture
    6 on at

    Hi,

    "No." field in Table Employee is same as the "No." field in Vendor Table.

    Therefore, you better assign a new "No." when inserting to Table Employee according to the No. Series you defined for the Table Employee as below,

    NextEmployeeNo := NoSeries.GetNextNo(Employee."No. Series", 0D, true);
    
    

    This will return the Next Employee No. where you can assign it to the "No." when inserting to Employee Table.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 612 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 489 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 285 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans