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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Create Customer Only When "Order" &"Guest" combination on sales quote page action using XMLPort

(0) ShareShare
ReportReport
Posted on by 2,126
Hi Community,
 
I have a client's requirement which is as follows:
 
While Importing CSV Files using XMLPort, we're not creating customers directly into the System(Customer Table), we're creating customers in the customer table only when /Document Type/ is /Order/ & /Sell-to Customer No/ is /Guest/ in Sales Quote Page using AL Code. For that, I have created XMLPort which is shown in the below Image. 
 
 
When I'm trying to import my CSV File it Shows following Error
 
This is the data that I want to import
 
For Example When I import this file if /Document Type/ is /Order/ & /Sell-to Customer No/ is /Guest/ then Customer /ABC/ & /XYZ/ Should be added into Customer Table.
 
  • Suggested answer
    Mohana Yadav Profile Picture
    61,260 Super User 2026 Season 2 on at
    As per the error, do you have 77777 customer in your database?
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at
    You can not create the customer in that trigger on the XML port.
    Try using the OnAfterInsertRecord trigger instead.
     
    In the OnPreXmlPort trigger your file is not read yet.
     
  • Inkey Solutions Profile Picture
    2,126 on at
    Hi @Inge M. Bruvik ,@Mohana Yadav
     
    Thank You for your Reply.
     
    @Mohana Yadav, No I don't have 77777 customer in the database.
     
    @Inge M. Bruvik, I have tried "OnAfterInsertRecord" trigger but it shows the following error. Do you have any other solution?
     

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 631 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 409 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 222 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans