Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Business Central

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.

Categories:
  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: Business Central

    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 

  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: Business Central

    Thankyou it worked

  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: Business Central

    Thankyou

  • Verified answer
    Amit_Sharma Profile Picture
    Amit_Sharma 2,545 on at
    RE: Business Central

    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

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Business Central

    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
    Bilal Haider Profile Picture
    Bilal Haider 45 on at
    RE: Business Central

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,219 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans