Hi all,
I have a form on which I want to apply filters based on the current system userid.
My codes is as follows:
Form - OnOpenForm()
SETRANGE("User ID",USERID);
Sometimes it gives the entries of this particular login but sometimes it shows all entries made by all users.
When it shows all the entries, I close the NAV application and restart my activity and then it is ok.
Please help where am wrong.
Thanks
Liizz
0
Comments
You need to use
FILTERGROUP(6);
SETRANGE("User ID",USERID);
FILTERGROUP(0);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have two forms with the same source table. One form shows the User ID and the other shows the Approver ID.
But, still when I use:
FILTERGROUP(6);
SETRANGE("User ID",USERID);
FILTERGROUP(0);
It prevents me from creating a new entry and I have to restart NAV application on the first form. I think the problem comes with the filters and it is not cleared. The source table is also blank.
I have read this thread: http://www.mibuso.com/howtoinfo.asp?FileID=22
Some advice: Only start using filtergroups from 10 and up. Filtergroups 0 to 6 are reserved (see the C/SIDE reference guide for more info), but I would keep some extra filtergroups free for the future (until some versions ago, filtergroup 6 was NOT reserved).
Can I use this instead:
1st form:
IF UserSetup.GET(USERID) THEN BEGIN
FILTERGROUP(10);
SETRANGE("User ID",UserSetup."User ID");
FILTERGROUP(0);
END;
2nd form:
FILTERGROUP(10);
SETRANGE(Approver,USERID);
SETFILTER(Status,'%1',Status::Released);
FILTERGROUP(0);
Is it a best way to fix this issue out??
Please advise me and help me sort it out.
Thanls
Liizz
t
You'll need to test it and make sure it works if users are entering records. If they are then you'll need to populate the user id automatically.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I didnt get your point here.
Its a customized table.
Thanks
Liizz
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n