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

Business Central

(0) ShareShare
ReportReport
Posted on by 200

users-ss.png

I Wanted to add multiple user in users and wanted to create sales order in each users and do post it how it can be done through Al code.

I have the same question (0)
  • Suggested answer
    Bilal Haider Profile Picture
    442 on at

    Hi Dividutt,

    To create users in BC SaaS, you first need to create a user in Microsoft 365 and assign a license.

    Then use the Update users from Microsoft 365 action on users page.

  • Suggested answer
    Bilal Haider Profile Picture
    442 on at

    To create a sales order using AL you need to create a Sales header and then sales lines. A simple code can be like this function below where you give customer No and Item No, and then document is created.

        procedure CreateSalesHeader(CustNo: Code[20]; ItemNo: Code[20])
        var
            SalesHeader: Record "Sales Header";
            SalesLines: Record "Sales Line";
        begin
            SalesHeader.init;
            SalesHeader.Validate("Document Type", SalesHeader."Document Type"::Order);
            SalesHeader.Validate("No.", 'SO100001');  //if Number from No. Series is required then comment this
            SalesHeader.Validate("Sell-to Customer No.", CustNo);
            SalesHeader.Insert(true);
    
            SalesLines.Init;
            SalesLines."Document Type" := SalesHeader."Document Type"::Order;
            SalesLines."Document No." := SalesHeader."No.";
            SalesLines."Line No." := 10000;
            SalesLines.Type := SalesLines.Type::Item;
            SalesLines.Validate("No.", ItemNo);
            SalesLines.Validate(Quantity, 1);
            SalesLines.Insert(true);
        end;

  • Suggested answer
    Amit Profile Picture
    2,561 on at

    Hello,

    For First Step- Refer this link-> https://erpconsultors.com/create-user-in-d365-bc-saas-or-online-version/ 

    Second Step- Create On Batch job and write code as per the above requiremnet

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Dividutt Profile Picture
    200 on at

    Thankyou

  • Dividutt Profile Picture
    200 on at

    Thankyou it worked

  • Dividutt Profile Picture
    200 on at

    nameuser1ss.png

    Yes, this is clear but I want to check sales order in multiple users which is posted and it is in posted sales shipments and want to check how many orders are there in posted sales shipment by keeping one hour difference then show that table in mail as given in image 

    So how can be done to check count of posted sales order on more than one user and total it in Al code

    Please help in this if possible

    Thankyou 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans