Sales Order

bekiobekio Member Posts: 204
Hello Everyone

For some reason sometimes i filter Sales Order to display just orders created by USERID(user id loged in-).
And sometimes i don't want to filter Sales Order form(this is depended on one field boolean that is added to User Setup table).
If this field("Show all" sales order) = TRUE than show all orders, and if this field is false than filter just created by this Assing User ID =USERID(user id loged on).
The problem is that this is not working, when i check or uncheck this field "Show all".
The code is like this:
I have write this code on triggers Form - OnOpenForm() and From - OnAfterGetRecord().

IF UserSetup.GET(USERID) THEN
IF UserSetup."See All Orders" THEN
EXIT
ELSE
BEGIN
SETRANGE("Assigned User ID",USERID);
END;


Any suggestions, where is wrong.
Thanks,

Answers

Sign In or Register to comment.