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();