You need to sign in to do that
Don't have an account?
margotw
How to check if the Opportunity records are cloned
I tried following the steps in Knowledge Article Number: 000181281 on how to check if an Opportunity record is cloned, but I'm getting an error message in the Apex Class.
Error: Compile Error: Method return types clash: clone() at line 8 column 22
Line 8 is: public PageReference clone(){
Any advice on how to fix this? TIA.
Here's the link to the Knowledge Article: https://help.salesforce.com/HTViewSolution?id=000181281&language=en_US
Error: Compile Error: Method return types clash: clone() at line 8 column 22
Line 8 is: public PageReference clone(){
Any advice on how to fix this? TIA.
Here's the link to the Knowledge Article: https://help.salesforce.com/HTViewSolution?id=000181281&language=en_US
if you can post your complete clone method code, we can see where its failing..
===============================VF page ==================================
<apex:page standardController="Opportunity" extensions="cloneopportunity" action="{!clone}">
</apex:page>
===============================Apex class===============================
public class cloneopportunity {
public opportunity o = new opportunity();
public opportunity c = new opportunity();
public cloneopportunity(ApexPages.StandardController controller) {
o = (Opportunity)controller.getRecord();
}
public PageReference clone(){
o = [select id, name, stagename, closedate, Clone__c from opportunity where id=: o.id];
c.name=o.name;
c.stagename=o.stagename;
c.Clone__c=true;
c.closedate=o.closedate;
insert c;
//PageReference pr = new PageReference('/'+c.id);
PageReference pr = new ApexPages.StandardController(c).view();
system.debug('>>>>>>>>'+pr); return pr;
}
}