You need to sign in to do that
Don't have an account?
geetforce
access "$Action.MyCustomObject__c.New" url in APEX code
Hi,
I have one VF page where I added one command button, on click on this I am redirecting the User to 'New' page of "MyCustomObject" which is Record Type selector page. Now I want to avoid this button click and whenever the User land on this page system should automatically redirect him to New MyCustomObject's page. But I don't know how to move this logic to Apex.
My VF page looks like :
<apex:commandButtonvalue="New Object" action="{!URLFOR($Action.MyCustomObject.New, $ObjectType.MyCustomObject)}"/>
Thanks in advance.
You can try using action to your page and define the redirect logic in apex code on that action method.
Now this method will be called before the page is actually rendered and you can optionally redirect the user to another page.
check this:
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm
Hi Sanjay33,
Yes I can implement this by using "ApexPage.action" but my issue is how to access "$Action.MyCustomObject__c.New" value in Apex. If I go with hardcoded value then it is working fine but failing when I move my code from one ORG to another ORG.
Regards