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...
Unanswered

creating sales order using AL code

(0) ShareShare
ReportReport
Posted on by 90

i created a middleware between business central and shopify and it works perfectly i can create customers and products in both way but the problem is creating sales order, i need to get the customers i added from business central to shopify and assign the relative information of the customer to sales order, but i cant get the customer id in business central, I only have the name, is there any way I can get the customer using Name, I tried setting filter using name but it did not work. 

Example:

I created order in Shopify POS this is the order object https://shopify.dev/api/admin-rest/2021-10/resources/order#resource_object 

when i get this object in AL I cant get the customer id , and when i create sales order i use this code 

                Order.Init();
                Order."No." := '';
                order."Quote No." := Order."No.";
                order."Document Type" := order."Document Type"::Order;
                order.Insert(true);
then i insert other data and modify 
also I need to insert in the lines i use this code in a loop through Shopify object 
                lines.Init();
                lines.SetRange("Document No.", order."No.");
                lines.SetRange("Document Type", order."Document Type");
                lines."Line No." := LineNo(1000);
                lines.Insert(true);
then insert the other data and modify();
can please help me, I can give more details if needed 
I have the same question (0)
  • Samantha73 Profile Picture
    3,247 on at

    You can lookup BC customer by setrange

    Cust.SetRange(Name,ShopifyName);

    If Cust.FindFirst() then

    ..your code

    But I'd store Shopify customer id in BC instead as looking up names is not the best practise

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