Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Restrict Field Access by Account

Kirsty Hannam

Recommended Posts

OK, a bit complicated this so I hope you can make some sense of it.


I have a database of staff records. Part of the system allows users to enter a report which is basically an assessment of how staff perform on a particular activity. The reports are written by the "Technical Expert" for that particular activity. These reports are a formal record and have to be "signed off" as a true record by both the member of staff and the Technical Expert. I'm achieving this with 2 fields, both are "yes/no" radio button sets. One field is called "signed off by staff" the other is called "signed off by Technical Expert". Sounds straightforward enough so far smiley-wink


Obviously, only the Technical Expert for that specific activity should be able to access the "signed off by Technical Expert" field and change it to a "yes" - I don't want someone else logging in and signing off staff reports! Similarly, only the relevant member of staff should be able to sign off their own reports. Reviewers need to be able to see all staff reports, but only able to sign off their own. Staff can only see their own reports, nobody elses. Up to this point, I'm OK.


Now I'm not sure how I'm going to fully explain this bit, but here goes:


I'm using privilege sets to limit access to the 2 fields in question, which I've based on a calculation under the "edit" part of the custom record privileges setup dialog:


Staff_Tech_Expert::Account_Name = Get ( AccountName )


The problem with this is that, although it works for the 2 fields in question, it also limits all the other fields on the report layout by the same criteria. Unfortunately, I end up in a Catch 22 situation:


In order to select their name as Technical Expert for this report, they need to have access to the field "Technical Expert Name" on the layout - which they can't do, as they are barred from accessing fields!


I can't think of a way around this problem. If anyone has any ideas, I'd be happy for some input as I just seem to keep going around in circles over this one! I guess what I want is to limit access to a specific field by calculation, whilst being able to give edit rights to all the other fields - I can't see a way to do it.


I've attached a screenshot of the layout, if that helps to visualise what I'm trying to do. Any help much appreciated.

Link to comment
Share on other sites

I've thought of a way of doing it smiley_cool !


I've come at the problem from a different angle. Instead of relying on privilege sets, I've slapped a script over each of the fields. When a user clicks on the field, they activate the script which then decides (based on their account) whether to set the field to a "yes" or not.


Both scripts are basically the same, just field references are changed. Attached is one of the scripts, in PDF format, for anybody that is interested.


There's nothing like solving a query last thing at night to ensure a restful night's sleep!

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use