You need to sign in to do that
Don't have an account?
zen_nj
trying to create button to invoke VF page, Content field empty even though I have 3 VF pages
I have set up a visualforce page (using a custom controller) on a custom object (call it FSL) and that works ok if I was evoking it by doing something like:
.../apex/VisualPageName/?id=a140000R000dx1df (whatever object id for an FSL entry that I want to run it against)
But now I want to create a custom button for FSL and associate it with the visualforce page so that when the user is a a particular FSL entry, they can click on this button and it will invoke the visualforce page (and it's workflow).
I thought I had done it before and when I did it in the past, I would click on the Create new custom button and select Detailed Page Buttno and then in the Content Source, select "Visualforce Page". And when I do that, I should be able to see in the Content pull-down menu a list of all the available VisualForce Pages.
But when I do this, the Content pull-down menu is empty, even though I have 3 visualforce pages set up.
Am I forgetting to do some additional configuration/setup to "publish" the visualforce page?
It's strange but I can see that I do have an older set up where I created a Case custom button that is invoking a Case visualforce page. But if I try to create a new button and use the exact same set up in the custom button, I would still see blank selection in the Content field.
Can someone please shed some light on this?
thx
Zen
.../apex/VisualPageName/?id=a140000R000dx1df (whatever object id for an FSL entry that I want to run it against)
But now I want to create a custom button for FSL and associate it with the visualforce page so that when the user is a a particular FSL entry, they can click on this button and it will invoke the visualforce page (and it's workflow).
I thought I had done it before and when I did it in the past, I would click on the Create new custom button and select Detailed Page Buttno and then in the Content Source, select "Visualforce Page". And when I do that, I should be able to see in the Content pull-down menu a list of all the available VisualForce Pages.
But when I do this, the Content pull-down menu is empty, even though I have 3 visualforce pages set up.
Am I forgetting to do some additional configuration/setup to "publish" the visualforce page?
It's strange but I can see that I do have an older set up where I created a Case custom button that is invoking a Case visualforce page. But if I try to create a new button and use the exact same set up in the custom button, I would still see blank selection in the Content field.
Can someone please shed some light on this?
thx
Zen
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=8508
http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=8508
By the way, I have logged a bug for our documentation writer to make this explicit in the docs. I'm not sure why it's not in there.
Message Edited by jwetzler on 01-08-2009 12:50 PM
You guys are correct and that only visualpage using standard controllers will be available/visible when trying to choose from the Content in creating custom button.
And what I did last time was to trick salesforce so that I can actually create custom button that will invoke visual page that is using a custom controller. So now that I remember that this was the problem, I was able to do it again. Essentially what I did was:
1. create a dummy visualforce page (essentially a holder) called VF_FSL and in that visualforce page, just declare it to be use
standard controller. So in my case I would just create a dummy visualforce page that really only have 3 lines:
<apex:page standardController="FSL">
Hello World
</apex:page>
2. I then went ahead and create a custom button for my custom object FSL and this time, when I indicate that my Content
Source is VisualForce page, now the Content pulldown will show VF_FSL as an available option and so I can select this.
I then add this custom button to my page layout accordingly and so now I have linked the visualforce page to my normal
page layout via this custom button.
3. Now I just need to edit my dummy visualforce page and change it so that it's no longer using standardcontroller but a
custom controller, and create the appropriate Class for that. And once that's done, I can still use the custom button to
invoke this modified visualforce page which now is using custom controller for enhanced functions.
The page you have will work fine as long as you give it a standardController, and use the current controller you have as an extension. Then you get all of the functionality of the standardcontroller, including even easier access to the id than having to ask for the current page parameters. If you're not familiar with extensions you should review the documentation for them. They are just as easy as writing a controller, and you get extra functionality.
Your "workaround" is not something that should be suggested as a solution. There is already support built into Visualforce for your needs, and I'd suggest that you go that route rather than hacking something in that may not work in the future.
/apex/pageName?id={!FSL.Id}
You'd also want the behavior to display in existing window without sidebar or header
Message Edited by TehNrd on 01-09-2009 09:22 AM
That is, depending on what values are in the FSL fields, I want to have certain things populated. Didn't know how (or if there is a way) to have url code perform logical checks and then assign specific values depending on the outcome of the logical check (i.e. if field1 = 'abc', then assign xxxx to yyy, else assign zzzz to yyy)
Message Edited by TehNrd on 01-13-2009 11:43 AM
I have corrected this per jwetzler recommendation so that I am now using a controller extension and this way I can use the logic/defaults which I don't think you can do using url (for custom button).