You need to sign in to do that
Don't have an account?
babloo123
Page Layout Assignment based on Profiles
I have a scenario where I am using a VF page on Object and based on Profile I need to assign the page layout.
Profile one needs to see VF page
Rest all profiles can see standard layout
but particular profile(Profile one should not have object view at all but see the VF page )
Can some one please help on this
Profile one needs to see VF page
Rest all profiles can see standard layout
but particular profile(Profile one should not have object view at all but see the VF page )
Can some one please help on this
However, you can hide the tab of that object from the profile such that he is not able to access the object from the UI..
visualforce page
javascript code
function checkProfile()
{
//check if user is admin or not
if({!userProfileName} == 'admin')
//redirect to standard page .You need to build url by passing id
}
else{
//redirect to custom page
}
}
checkProfile();
I took following code from http://salesforce.stackexchange.com/questions/29361/conditionally-rendering-visualforce-element-based-on-user-profile
controller
public String userProfileName { get { return [ select Profile.Name from User where Id = :Userinfo.getUserId() ].Profile.Name; } }
Hope this helps.