You need to sign in to do that
Don't have an account?
sf consultant.ax380
Simulating a custom button / link in a VF Page?
Hey guys, VF Newbie trying to figure out best approach.
Currently... on my case layout I have a custom link which calls an custom S-Control with the behavior
of Display in new window (ie.. popup) This s-control simply builds a bunch of querystring parms and changes the window's location to an external app passing these parms and then I'm good.
I have built a new VF page and I want to add the same functionality that custom link is providing on that standard case page.
Is there a way in VF to.............
1. reference this custom link and "drop it" on the page so as I can reuse all the existing code. (I don't think so)
2. maybe utilize a commandLink (I don't need a server side action called) and then in the onclick of the command link somehow tell it to utilize the existing custom s-control and popup a new window with specific height / width.. etc.???
The more I think about this the more I know I'm thinking about this all wrong!!! :)
Any help would be appreciated!!
Thanks
Currently... on my case layout I have a custom link which calls an custom S-Control with the behavior
of Display in new window (ie.. popup) This s-control simply builds a bunch of querystring parms and changes the window's location to an external app passing these parms and then I'm good.
I have built a new VF page and I want to add the same functionality that custom link is providing on that standard case page.
Is there a way in VF to.............
1. reference this custom link and "drop it" on the page so as I can reuse all the existing code. (I don't think so)
2. maybe utilize a commandLink (I don't need a server side action called) and then in the onclick of the command link somehow tell it to utilize the existing custom s-control and popup a new window with specific height / width.. etc.???
The more I think about this the more I know I'm thinking about this all wrong!!! :)
Any help would be appreciated!!
Thanks
After someone else at my organization made a custom button, I opened the button detail and it included something like this:
Behavior: Display in new window
Display Type: Detail Page Link
Button or Link URL: https://na5.salesforce.com/00O70000002FKsL?pv0={!myObject__c.Id}
To get a button that looks and works the same I used this HTML trick, including using the salesforce CSS class 'btn' to get the styling right.
Of course, you could just use a regular link - a href - it will do the same thing - but this makes it look like a custom button.
I stuck it inside an apex pageBlockButtons section to make it go where I wanted. You just need to make sure you have access to the object id (where it says !object.id) through the controller or otherwise. I get it from a SOQL query in the controller.
Dunno if you have the same kind of custom button but this is one way to go.
-paul
Message Edited by ptepper on 09-11-2008 01:17 PM
All Answers
After someone else at my organization made a custom button, I opened the button detail and it included something like this:
Behavior: Display in new window
Display Type: Detail Page Link
Button or Link URL: https://na5.salesforce.com/00O70000002FKsL?pv0={!myObject__c.Id}
To get a button that looks and works the same I used this HTML trick, including using the salesforce CSS class 'btn' to get the styling right.
Of course, you could just use a regular link - a href - it will do the same thing - but this makes it look like a custom button.
I stuck it inside an apex pageBlockButtons section to make it go where I wanted. You just need to make sure you have access to the object id (where it says !object.id) through the controller or otherwise. I get it from a SOQL query in the controller.
Dunno if you have the same kind of custom button but this is one way to go.
-paul
Message Edited by ptepper on 09-11-2008 01:17 PM