Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

bulk salesorder to inserted in background while UI(Business central) not stucked

Posted on by 4
i have a scenrio that i have a functionality in which user can select multiple sales order they might be of  thousands in quantity and the there is a report which acts as a job it inserts that orders i have all the functionality i have the requirnment that all of that sales orders when it inserted the UI(Business central) could not be hanged or stucked the insert functionality works on background and modify at the background. Any luck how can i achieve this kind of any async or and background thread so i can achieve it TIA.

here is a piece of code, 
                    CurrPage.SetSelectionFilter(SalesHeader);
                    SalesHeader.SetFilter(/No./, SelectionFilterManagement.GetSelectionFilterForSalesHeader(SalesHeader));
                    SalesHeaderRec.SetFilter(/No./, SalesHeader./No./);
                    if SalesHeaderRec.FindSet() then
                        repeat
                            SalesHeaderRec.BillType := BillType.FromInteger(Selected);
                            SalesHeaderRec.Modify();
                        until SalesHeaderRec.Next() = 0;
                    Commit();
 
need that this line is to be run in background SalesHeaderRec.Modify();
Categories:
  • bulk salesorder to inserted in background while UI(Business central) not stucked
    YUN ZHU  i tried but this not works as page background tasks are for read only purpose i have tried the start session but can able to sort out as i have to run this function    GG_ShipGuruMethods.CreateSalesLineAndPurchaseInvoice(_salesId, 24, Selected);
    in that to be run in background.
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    bulk salesorder to inserted in background while UI(Business central) not stucked

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans