Page Override not working

  • 3
  • Problem
  • Updated 4 years ago
  • In Progress
I have created a tab override for a Person Account Record type. However, this will not load as it should.

The scenario is:
For Profile "Youth Development Manager" I want a custom tab that overrides the Account tab to just show Person Accounts with Record type "Young Person".

My VF page code is:


<apex:page standardController="Account" recordSetVar="c"
extensions="skuid.Redirects"
action="{!redirect}?objecttype=Account&actionType=Tab&recordType=Young_Person">
</apex:page>


I have a Page Association for Object type Account; Action type Tab; Applies to: Youth Development Manager; Record Type: Young Person; Page to Use: Young Persons.

I am guessing this is something to do with Person Accounts?
Photo of David Woodhead

David Woodhead

  • 252 Points 250 badge 2x thumb
  • confused

Posted 6 years ago

  • 3
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Hi David, what is happening when you try to pull up a Person Account? Do you just get the standard page still? Or are you getting an error or blank screen of some kind? Also, does your browser redirect to a page and then quickly redirect again?
Photo of David Woodhead

David Woodhead

  • 252 Points 250 badge 2x thumb
Ben - this is trying to force an override on the tab - not a detail page. I have built a page that just lists of a single record type, this being a Person Account record type.

regards the 2nd part of your question, yes, if I look at the URL bar, the redirect appears to happen (links to https://na5.salesforce.com/servlet/se...), but then it reverts back to the standard with this URL: https://na5.salesforce.com/001/o?noov...

David
Photo of Anna Wiersema

Anna Wiersema

  • 10,890 Points 10k badge 2x thumb
David, do you want to create a separate VisualForce tab for Person Accounts? In that case, you need to set your VF page to override the Person Account custom tab. (Setup > Create > Tabs).

On the other hand, if you are wanting to use this page to override the standard Accounts tab, then make sure that you have set this page to override the Tab action in Customize > Accounts > Buttons and Links.
Photo of David Woodhead

David Woodhead

  • 252 Points 250 badge 2x thumb
Still cannot get my VF tab to work. This is the mark up on the VF page:

Which I think is as directed in your help guide.

There is no Person Account object, so this must call the Account. The preview page works fine, but I am unable to get the override working.
Photo of David Woodhead

David Woodhead

  • 252 Points 250 badge 2x thumb
VF markup is as above in first comment.
Photo of David Woodhead

David Woodhead

  • 252 Points 250 badge 2x thumb
This is probably just me, but I am also having problems getting a new Tab to render. I am, I guess, not using the page redirect correctly. I have built a Tab page, and I do not want it to override anything, just act as a new tab that gives me a new view of data. It works fine in Preview, but I am unable to get the tab to load correctly when deployed. I cannot find anything on the help pages that gives instructions for creating a VF tab that is not overriding a standard page. Can you illuminate me?

BR
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
David,

Assuming that you are trying to create a new tab called "Young Persons", which just shows Accounts of the Young Person record type, and are using a Visualforce Tab to accomplish this, here's what you should do:

1. Create a Visualforce Page called "YoungPersonTab" or something like that, with the following VF Markup:



<apex:page controller="skuid.Redirects"
action="{!redirect}&objecttype=Account&actionType=Tab&recordType=Young_Person">
</apex:page>


Notice several things:

a. For the Visualforce Tab, we did not use any standard controller at all, but rather just used the Skuid Redirects class as the controller.
b. Having the "recordType=Young_Person" parameter here is optional. Really all that this parameter is telling Skuid is: go find a Page Assignment record where "Record Type" is equal to "Young_Person". What this does not do is to force Skuid to only find Accounts of the Young_Person record type --- this is the responsibility of the Skuid Page that you specify should be used to serve the Page Assignment.

2. Create a Page Assignment record with the following fields specified:
Object Type: Account
Action Type: Tab
Record Type: Young_Person
Skuid Page to use: "YoungPersons"
Applies To: Organization Default

The last part, the applies to, is very important: you are probably getting redirected, as Ben suggested, because your profile is System Administrator, not Youth Development Manager. Unless you have a Page Assignment that matches your Profile, you will not get redirected to any Skuid Page at all.

Now, once you have this Page Assignment created, if you need to show different content for this Tab when the running user has the Youth Development Manager profile, you need to have a separate Page Assignment record like this:

Object Type: Account
Action Type: Tab
Record Type: Young_Person
Skuid Page to use: "YoungPersons_YouthDevManager"
Applies To: (Profile) Youth Development Manager
Photo of ddeveaux

ddeveaux

  • 1,202 Points 1k badge 2x thumb
This was helpful as I was having same issue. I think the challenge is that this somewhat conflicts, or at least adds new information to the Support docs. Once I used Zach's solution my page worked perfectly.