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 Customer Only When "Order" &"Guest" combination on sales quote page action using XMLPort

(0) ShareShare
ReportReport
Posted on by 2,100
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.
 
I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    As per the error, do you have 77777 customer in your database?
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 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,100 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

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

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans