Hi All,
I have added code to restrict users from viewing/accessing Sales Orders in the Page 9305-Sales Order List based on the Salesperson/Purchaser code in the Sales Order. Each user is assigned a Salesperson in the User setup page. All is fine and the Sales Order List display only the expected sales orders.
But the user can now clear the page filter and see all the sales orders irrespective of the coded filter. I would like to know how can I restrict users with certain rights from clearing the filter.
0
Comments
As above, just remember to set the FILTERGROUP back to 0 after setting your filters.
is it Ok to use the FILTERGROUP(2) and FILTERGROUP(0) one after the other in same trigger.
The following code is from Std Nav 2013.
IF UserMgt.GetSalesFilter <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Responsibility Center",UserMgt.GetSalesFilter);
FILTERGROUP(0);
END;
I have placed my new code just below this code
IF UserSetup.GET(USERID) THEN BEGIN
IF UserSetup."Salespers./Purch. Code" <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Salesperson Code",UserSetup."Salespers./Purch. Code");
FILTERGROUP(0);
END;
END;