Filtering records as per USERID

Hi there, I need a little help on this one. One of our client want to filter the records to view according to the user. This should work like this if the user logs in and he belongs to the location lets say loc1. Then he will be allowed to view the records only from that location not fm any other location. Can anyone put a light that what will be the best way of doing this. I know the one way is modify all the forms and put the filter on it. Thanx in advance Jag Jagjeet

Hi Jagjeet, it would be nice to know the Navision version of you client. Navision Attain has a very basic function on this using “responsibility center” (I hope they have resolved some problems with this in the next version). With the responsibility center a user assigned to this canter can only “see” entries related to this center (orders, customers). However, if the user has the permission to work with GL, will not work on this. Ohhh, years ago, with this lovely Dos based Navsision Version there was a function called “globalfilter”. Setting this globalfilter just after a login, (e.g. Table.UserID = Username) this filter was valid in the whole application. A “set” for this globalfilter is available in Navision Financials/Attain but it is not working. Since 6 years they are writing “may be used in future versions of Navision” in the help text. Regards Walter

Hi walter, Thx for the reply, We are using Navision Version 2.60F (Australian Version). Jagjeet

we want to do the filter on complete system not only on sales, purchase but also on jobs, production, warehouse, GL, Contacts etc. etc. Jagjeet

Hi Jagjeet! Hmmm … that could cause a lot of programming … What you need is basicly: 1. A relation of USERID and location, maybe a new field in Table 91 “Location ID” 2. Mark a record (When? What defines a record to belong to a special location?) with a “Location ID” (new field) and then filter on that “Location ID” by the users “Location ID”, e.g.

UserSetup.TESTFIELD("Location ID");
Record.SETRANGE("Location ID", UserSetup."Location ID");

That means, that a Record-Loc1 would only be shown to users Loc1. This record could never be shown to users Loc2 or others … is that what you want? You need to add a field in every table that should be filtered, you need to mark every record with a location, … Maybe you could think of handling this by different companies Regards, Jörg Joerg A. Stryk Apollo-Optik, IT/ERP

Hi for a similar case we create some new (blank)roles. These roles are tested by the following code:

"!Mitglied von".SETCURRENTKEY("!Mitglied von"."User ID","!Mitglied von"."Role ID");
"!Mitglied von".SETRANGE("!Mitglied von"."User ID",USERID);
"!Mitglied von".SETRANGE("!Mitglied von"."Role ID",BenutzerID_);
IF "!Mitglied von".FIND('-') THEN BEGIN

Here you can set a filter!


Here you can set another filter!


Maybe this helps bye Andre

Well, you could always move to 3.01B or above - SQL version - and use record level security. Might be a bit drastic for you though!

I don’t know what I am missing out but couldn’t any user simply remove the filters (View - Show All) and access all the data - independant of his location? I guess the only reasonable way is either use Attain responsibility centers or different companies… Saludos Nils

Nils : If you use FILTERGROUPS you can disable the SHOW ALL Button ######

Moved to “Attain Development Forum” from Open Subject