You need to sign in to do that
Don't have an account?
Possible to hide objects based on field values?
Hi, I am wondering if there is a way to hide opportunities or accounts or other objects for a user with a specific profile or role based on field values on the particular object?
Thanks / Niklas
That sounds like Criteria Based Sharing. Vote for it here:
http://sites.force.com/ideaexchange/ideaSearchResults?q=criteria+based+sharing&cx=&cof=&c=09a30000000D9xt&s=criteria+based+sharing&searchType=c&thisSite.x=0&thisSite.y=0&thisSite=c
Currently, I don't think its possible without writing some customizations. You can see if Apex Managed Sharing will meet your needs, or you could create a custom VisualForce UI with an Apex Class extension that adds your custom logic.
You could also add a field to your records that specifies the sensitivity level of the record. For example, Opportunity.sensitivity__c has values of {1, 2, 3}. Based on the user's Role, Profile, or Group Membership you could create a SOQL query to only show records with a certain sensitivity level.
PseudoCode:
String SensitiveProfile = '00exxxxxxxxxxx';
Profile ThisProfile = [select Name from Profile where Id = :userInfo.getProfileId()];
If (ThisProfile.Id == SensitiveProfile) {
List <Opportunities> Opps = [SELECT Name, Id, FROM Opportunities WHERE sensitivity__c = 3 LIMIT 100];
return Opps;
}
else {
// Access Denied
}
Of course that may be overkill.
Hope that helps!
All Answers
That sounds like Criteria Based Sharing. Vote for it here:
http://sites.force.com/ideaexchange/ideaSearchResults?q=criteria+based+sharing&cx=&cof=&c=09a30000000D9xt&s=criteria+based+sharing&searchType=c&thisSite.x=0&thisSite.y=0&thisSite=c
Currently, I don't think its possible without writing some customizations. You can see if Apex Managed Sharing will meet your needs, or you could create a custom VisualForce UI with an Apex Class extension that adds your custom logic.
You could also add a field to your records that specifies the sensitivity level of the record. For example, Opportunity.sensitivity__c has values of {1, 2, 3}. Based on the user's Role, Profile, or Group Membership you could create a SOQL query to only show records with a certain sensitivity level.
PseudoCode:
String SensitiveProfile = '00exxxxxxxxxxx';
Profile ThisProfile = [select Name from Profile where Id = :userInfo.getProfileId()];
If (ThisProfile.Id == SensitiveProfile) {
List <Opportunities> Opps = [SELECT Name, Id, FROM Opportunities WHERE sensitivity__c = 3 LIMIT 100];
return Opps;
}
else {
// Access Denied
}
Of course that may be overkill.
Hope that helps!
Or I guess you could make every field hidden lets say for Accounts for that profile
You will not get rid of the ta/object unless you also make the tab hidden
Based on your field value, the workflow will change the record type, which would be assigned to a page layout that does not have the have the hidden object under related lists. On top of that, the page layout for the hidden object would have all possible fields removed from the layout to hide as much of the information as possible and hide the tab. This is a nutshell explaination, I'm happy to go into more detail if this is still an issue for people.