You need to sign in to do that
Don't have an account?
uptime_andrew
Clone Button on VF Page Leads to Error
I'm using a commandButton on a Visualforce page to override the Case View.
<apex:commandButton action="{!clone}" value="Clone" />
When clicking this, I get the following error:
"Return type of an Apex action method must be a PageReference. Found: core.apexpages.el.adapters.ApexObjectValueELAdapter"
Do I need to do a custom PageReference function in my extension class to handle this? I thought I would be able to do this with a standard button?
https://cs3.salesforce.com/apex/uptimeCaseView?id=500Q0000003JhDe
Thanks Jill. I managed to get it working through an input tag:
All Answers
Hm that is not cool. You're using the standard controller for Case + an extension? Does your extension class have a field or a method in it called clone, by chance?
Oh sorry, it appears that clone is not a method on the standard controller: http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/apex_pages_standardcontroller.htm?SearchType=Stem
So yeah you will need to implement this yourself. This should work, with the caveat that it's a bit of a hack to put clone=1 at the end of your URL, I'm not sure that is documented as being officially supported but it should be stable enough for you.
Thanks Jill. I managed to get it working through an input tag:
Thanks Jill, that works like a charm :)