It may not be the proper way but this is how i did it:
Edit the user's privilege set and for Records: select Custom Priviledges.
On the Custom Record Privileges select your Contacts table and under the View setting, select limited.
You can then enter a calculation to the effect of CreatedBy = Get ( AccountName )
This will allow them to only view records that have their Account name in the created field. I then created a login script that says
If Get ( CurrentPriviledgeSet ) = Rep (as an example)
Enter Find Mode
Set Field [CreatedBy; Get ( AccountName )]
Constrain Found Set
The end result is when they login, they are shown only their records, and if by chance the come across a record that is not created by them (by clicking show all or searching for a record that is not theirs) they will not be able to see the data, it will say <<No Access>> in all fields.
I also wanted to add, this method is assuming that your CreatedBy field is set with their account name.
I will give this a go.. and yes your second comment is the way im doing it..
Q. In a list view will it only show the user account records..due to Perform find & contrain?
Yes, but if they click show all, it will show everything and will see <<No Access>> in the fields of records they didnt create.
You set this in the Security Settings for the permission group by selecting "Limited" under the editing records setting and entering:
UserName_Created = Get ( AccountName )
This assumes that you have an auto-enter value of the Account_Name being entered into the UserName_Created field. I would point out that Creation Name and Creation Account Name are not always the same name. Use the Creation Account Name for the auto-enter value so it will have to match the logged in Account Name.
At the bottom left of your screen where it says View: Yes. Change Yes to limited and add the calc there.
1 of 1 people found this helpful
Most folks auto-enter Account Name to easily know who has created a record but Account Name is just as vulnerable to breaking as using a person's real name because sometimes they change the account name. If this happens, and you search for a Users records by their current Account Name, you may not find all records. This is especially true if you use CreatedBy for relationship.
True that changing Account Name should not happen but it does. The safest is store Account Name in Staff table (user record) and upon opening, find the account name and set global field or global variable to the unique StaffID and use the ID for auto-enter. If Separation ( and using global variable ) then remember that global variables are file-specific so it needs to be set in the Data table for auto-enter.
You make a very good point & one that Im now rethinking my options. so thanks