How to check count of sales order on posted sales shipment for previous month for multiple users
As shown in the image I want to show count of sales order for previous month in posted sales shipment how can I do in Al code please help
Hi,
I tried the code but not getting the expected result,
Is it necessary to setrange on user id as it will be not null?
And I am also not getting the expected order count.
I want to check on multiple users and it's posted sales shipment
And display it's order which is 31 days back from today.
Rec_postedsales.setrange(Posting date, Today -31,Today)
How can get sales order count for each day?
Still stuck with that.
Is there any other suggestions please do help.
Thankyou
Thankyou, I will check it and update.
Hi,
Can you try below functions? Make sure for the Total posting date count message you manage it better way, I just showing you total counts in the loop.
procedure orderpacked()
var
rec_postedsales: Record "Sales Shipment Header";
rec_postedsales2: Record "Sales Shipment Header";
rec_User: Record User;
user: text;
TotalUserOrder: Integer;
XpostingDate: Date;
begin
rec_postedsales.Reset();
rec_postedsales.SetRange("User ID", '<>%1', '');
rec_postedsales.SetRange("Order No.", '<>%1', '');
TotalUserOrder := rec_postedsales.Count;
Message('Total user''s orders:%1', TotalUserOrder);
rec_postedsales.Reset();
rec_postedsales.SetCurrentKey("Posting Date");
rec_postedsales.SetRange("Posting Date", CalcDate('<-1M-1D>', workdate()), WorkDate());
rec_postedsales.SetRange("Order No.", '<>%1', '');
if rec_postedsales.FindSet() then
repeat
if XpostingDate <> rec_postedsales."Posting Date" then begin
rec_postedsales2.Reset();
rec_postedsales2.SetRange("Posting Date", rec_postedsales."Posting Date");
Message('Total Orders %1 on Posting Date %2', rec_postedsales2.Count, rec_postedsales2."Posting Date");
end;
XpostingDate := rec_postedsales."Posting Date";
until rec_postedsales.Next() < 1;
end;
|
I needed to find count of sales order which is in posted sales shipment from all users which is the in User table,
Also check one month before form today and check how many sales order are posted on each day, how this can be filtered?
Is it the user or the sales person you are looking to collect data off?
You have to loop through the sales person table, filter the shipment on the sales person in the loop and the date span you want to look at and do a saleshipment.count to find the number for each sales person.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156