Search code examples
salesforceapexvisualforce

To show different list page for different profile


I have two vf pages, say vf1 and vf2, which have standard controller for same object say Leads. Now i want to show vf1 page for edit button for any profile1 and and vf2 page for profile2 on edit button.

Tried to see any option in Profile menu, but not able to find anything for page assignment for list/edit/create/...etc. for an object.


Solution

  • There is no such feature in Salesforce to allow visualforce page assignment per profile.

    I would recommend below

    1.Create a hirerachy custom setting to store the mapping between the vf page and the profile .

    2.Write a vf that will be assigned for all profiles but on action (called upon where page loads) it will look into the hirerachy custom settings map and takes the user to right visualforce page .You can pass along page parameters as query parameters .