You need to sign in to do that
Don't have an account?
Jimmy Armstrong
$object.ApexPage on Custom button javascript
Hi,
I am trying to use the {!$ObjectType.ApexPage} merge field to get the name of a VF page.
This is used on Execute-javascript behavior on a custom button. However I cannot access the
page name that I want to.
For e.g.
If the page name is test01 and I try this.
{!$ObjectType.ApexPage.test01}
it throws a syntax error
I can hardcode the VF page name but then I would have to prepend it witht the namespace once I create
a package. This has to be avoided
Any help would be great
Thanks
-Kedar
Hi,
You should be able to use the syntax: {!$Page.test01} to reference your page.
From VF documentation (under global variables)click here
Regards,
Rich.
Thanks for your comment.
But the problem is I cannot access $Page on Execute-javascript behavior of a custom button.
Only the $object.ApexPage global variable is avaialble and it won't
allow me to access the page.
Sorry, should have read the message properly...
Can't offer a solution to this, sorry. In the past (1-2 years ago) there was definitely no solution to this and we ended up prepending the namespace to the button urls. We had 2 buttons for each function; one with, one without the namespace and just added the correct one to the page layout as necessary. It is *really" dirty to do that but that was a solution we came up with at the time.
Not sure if there are any better solutions out there these days - lets see what the community comes up with.
Good luck.
Rich.