Just taking a stab at this, I would add a field in your postcodes table for User. In your script you do a find in the User field based on Get(AccountName) or Get(UserName) depending on how you have it set up. To quickly populate the field with the correct data you could create a calculation field for the starting digit of the postcode: Left(postcode; 1), do a find for 6, do a Replace Field Contents on the new User field with HR1, etc.
If you wanted to get fancy you could create an additional table with one record and create a User field to relate to the postcodes table and display the records in a portal.
I'm not sure exactly what you're trying to accomplish but maybe this will give you some ideas.
Or set up a global variable (based on a table accessed on opening the database, determining whether a given individual user is HR1, HR2, etc.) and use that global variable throughout the individual's session to determine what he/she should see.
HR1 is User
HR2 is User
HR3 is User
HR1 must see all postcodes started with 6
HR2 must see all postcodes started with 7
I have 60.000 records where i have 200 diverent "postcodes".
Currently i can not match this thinks together. I tried to make a user_id but i cant hole the ID from filemaker?
If you control Users' Record Level Access (RLA) at the permission group level, you don't have to complicate your Find scripts with all the possibilities.
If there is any predictable consistency between the User and the postcode system, you can control this at the Security - Permissions level of the file. For instance:
- GetAsNumber (User) + 5 = GetAsNumber ( Left ( postcodes ; 1 ) )
- This might work for for Record Level Access (RLA) controls in the permission group settings for limiting viewing of records of the sample users you gave, but that type of consistency between users and postcodes is not realistic for 200 postcodes.
Record Level Access controls in the Security-Permissions needs to find some type of calculation which can return a True result. This may require having a table for postcodes which has a field indicating which user number(s) are allowed to view it, and then using that as a match value for the RLA calculation.
sorry for the late answear,
Behind the 200 Postcodes we have 60.000 customers. Our salesforce is a structure form. f.e. Postcode 1 is city frankfurt, mainz and wiesbaden. Now i want to give this information to 10 sales reps. so this 10 persons see only the 3 cities.
We have addiotonal structures included. postcode 1 contains f.e. strets with A or B. So when i define the permission i say
User 1 - Postcode 1 - streets A
User 2 - postcode 1 - streets B
User 3 - postcode 1 - streets A and B
In the database i have dropdown menue for: Username, Postcode, Streets. This llayout is viewable as admin.
The admin says. User 1 Postcode 1 Street A
When the User look in, he will see a listview with all customers from postcode 1 and lived in street A.
Hope this is a little bit clearer now :-D
How many Sales Reps do you have, and do they each have their own Account Name?
Do you have separate Permission groups for different user Accounts, or are you in need of restricting one permission group in a way that is flexible for the record-controls on all users separately within that group?
If you have multiple permission groups for user accounts, how many permission groups do you need to limit?