+ Start a Discussion
kumar.fdc81.3902978579608325E12kumar.fdc81.3902978579608325E12 

URL No Longer Exists error in salesforce

Hi all,

I Overrided in CLONE button.

VF Page:-
------------

<apex:page standardController="Opportunity_Deal_Risk_Assessment__c" extensions="OpportuintyDealClone"> <apex:form > <script type="text/javascript"> function doValidation() { // do checks here if(Opportunity_Deal_Risk_Assessment__c.CreatedById = Opportunity_Deal_Risk_Assessment__c.User__c) { return false; } //etc. if(Opportunity_Deal_Risk_Assessment__c.CreatedById != Opportunity_Deal_Risk_Assessment__c.User__c) return true; } </script> <apex:pageBlock title="Opportunity Deal Risk Assessment Edit"> <apex:pageblockSection title="Approval" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.PD_Delivery__c}" required="true"/> <!-- <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.DealRiskAssessmentPDDelivery__c}" /> --> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.User__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Project Size" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Opportunity__c}"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.ProjectSize_Total_Number_of_Person_Days__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Complexity" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Complexity_Standard_impl_package__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Complexity_Countries_Regions_in_scope__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Complexity_Decision_Making__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Solution Fit and Business Benefit" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Solution_Fit_Requirements__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Solution_Fit_Business_Benefits__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Solution_Fit_Solution_Fit__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Solution_Fit_Product_Availability__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Productization, Customizations, and Extension" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Complexity__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Deal_type__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Customization_Maintenance__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Integration_complexity__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Integration_deal_type__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Report_Volume__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Report_complexity__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Productization_Report_deal_type__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Contract/SOW" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Contract_SOW_Penalties__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Contract_SOW_Proposal_type__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Contract_SOW_Project_Margin__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Contract_SOW_Project_rates__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Customer Capability" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_Project_Sponsor__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_decision_making_sales_cycle__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_PM_capability__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_IT_capability__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_Business_Process_Flexibility__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Customer_Existing_systems__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area SumTotal PS Staffing" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.SumTotal_Offshore_bgt_of_tot_proj_hrs__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.SumTotal_Proj_Mgt_of_tot_proj_bgt_hrs__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.SumTotal_STS_Staffing_Gaps__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.SumTotal_3rd_Party_Resources__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Project Management" columns="1"> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Project_Scope_definition_days__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.RD_Total_deal_contingency__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Project_Methodology__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Project_ST_Project_Experience__c}" required="true"/> <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Project_Education__c}" required="true"/> </apex:pageblockSection> <apex:pageblockSection title="Area Conversion" > <apex:inputField value="{!Opportunity_Deal_Risk_Assessment__c.Conversion_Dataconversion_responsibility__c}" required="true"/> </apex:pageblockSection> <apex:pageBlockButtons > <apex:actionFunction action="{!cloneRecord}" name="callAction"/> <apex:commandButton value="Save" action="{!cloneRecord}" onclick="if(doValidation()) callAction();"/> <apex:commandButton value="Save & New"/> <apex:commandButton value="Cancel" action="{!Cancel}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>

Apex Class:-
----------------

public with sharing class OpportuintyDealClone {

   Public Opportunity_Deal_Risk_Assessment__c currentRecord {get;set;}
   public Opportunity_Deal_Risk_Assessment__c newRecord {get; set;}
   
 public OpportuintyDealClone (ApexPages.StandardController controller) 
    {
     newRecord = new Opportunity_Deal_Risk_Assessment__c();
     
     currentRecord = (Opportunity_Deal_Risk_Assessment__c)controller.getRecord();
     
/*     currentRecord = [select Id,PD_Delivery__c,Opportunity__c,ProjectSize_Total_Number_of_Person_Days__c,Complexity_Standard_impl_package__c,Complexity_Countries_Regions_in_scope__c,
                       Complexity_Decision_Making__c,Solution_Fit_Requirements__c,Solution_Fit_Business_Benefits__c,Solution_Fit_Solution_Fit__c,Solution_Fit_Product_Availability__c,
                       Productization_Complexity__c,Productization_Deal_type__c,Productization_Customization_Maintenance__c,Productization_Integration_complexity__c,
                       Productization_Integration_deal_type__c,Productization_Report_Volume__c,Productization_Report_complexity__c,Productization_Report_deal_type__c,
                       Contract_SOW_Penalties__c,Contract_SOW_Proposal_type__c,Contract_SOW_Project_Margin__c,Contract_SOW_Project_rates__c,Customer_Project_Sponsor__c,
                       Customer_decision_making_sales_cycle__c,Customer_PM_capability__c,Customer_IT_capability__c,Customer_Business_Process_Flexibility__c,Customer_Existing_systems__c,
                       SumTotal_Offshore_bgt_of_tot_proj_hrs__c,SumTotal_Proj_Mgt_of_tot_proj_bgt_hrs__c,SumTotal_STS_Staffing_Gaps__c,SumTotal_3rd_Party_Resources__c,
                       Project_Scope_definition_days__c,RD_Total_deal_contingency__c,Project_Methodology__c,Project_ST_Project_Experience__c,Project_Education__c,
                       Conversion_Dataconversion_responsibility__c from Opportunity_Deal_Risk_Assessment__c where id =:currentRecord.id];
  */                      
  //    newRecord.Name= currentRecord.Name;
       newRecord.PD_Delivery__c= currentRecord.PD_Delivery__c;   
      newRecord.Opportunity__c= currentRecord.Opportunity__c;
      newRecord.ProjectSize_Total_Number_of_Person_Days__c= currentRecord.ProjectSize_Total_Number_of_Person_Days__c;
      newRecord.Complexity_Standard_impl_package__c= currentRecord.Complexity_Standard_impl_package__c;
      newRecord.Complexity_Countries_Regions_in_scope__c= currentRecord.Complexity_Countries_Regions_in_scope__c;
      newRecord.Complexity_Decision_Making__c= currentRecord.Complexity_Decision_Making__c;
      newRecord.Solution_Fit_Requirements__c= currentRecord.Solution_Fit_Requirements__c;
      newRecord.Solution_Fit_Business_Benefits__c= currentRecord.Solution_Fit_Business_Benefits__c; 
      newRecord.Solution_Fit_Solution_Fit__c= currentRecord.Solution_Fit_Solution_Fit__c;  
      newRecord.Solution_Fit_Product_Availability__c= currentRecord.Solution_Fit_Product_Availability__c;
      newRecord.Productization_Complexity__c= currentRecord.Productization_Complexity__c;
      newRecord.Productization_Deal_type__c= currentRecord.Productization_Deal_type__c;
      newRecord.Productization_Customization_Maintenance__c= currentRecord.Productization_Customization_Maintenance__c;
      newRecord.Productization_Integration_complexity__c= currentRecord.Productization_Integration_complexity__c;
      newRecord.Productization_Integration_deal_type__c= currentRecord.Productization_Integration_deal_type__c;
      newRecord.Productization_Report_Volume__c= currentRecord.Productization_Report_Volume__c;
      newRecord.Productization_Report_complexity__c= currentRecord.Productization_Report_complexity__c;
      newRecord.Productization_Report_deal_type__c= currentRecord.Productization_Report_deal_type__c;
      newRecord.Contract_SOW_Penalties__c= currentRecord.Contract_SOW_Penalties__c;
      newRecord.Contract_SOW_Proposal_type__c= currentRecord.Contract_SOW_Proposal_type__c;
      newRecord.Contract_SOW_Project_Margin__c= currentRecord.Contract_SOW_Project_Margin__c;
      newRecord.Contract_SOW_Project_rates__c= currentRecord.Contract_SOW_Project_rates__c;
      newRecord.Customer_Project_Sponsor__c= currentRecord.Customer_Project_Sponsor__c;
      newRecord.Customer_decision_making_sales_cycle__c= currentRecord.Customer_decision_making_sales_cycle__c;
      newRecord.Customer_PM_capability__c= currentRecord.Customer_PM_capability__c;
      newRecord.Customer_IT_capability__c= currentRecord.Customer_IT_capability__c;
      newRecord.Customer_Business_Process_Flexibility__c= currentRecord.Customer_Business_Process_Flexibility__c;
      newRecord.Customer_Existing_systems__c= currentRecord.Customer_Existing_systems__c;
      newRecord.SumTotal_Offshore_bgt_of_tot_proj_hrs__c= currentRecord.SumTotal_Offshore_bgt_of_tot_proj_hrs__c;
      newRecord.SumTotal_Proj_Mgt_of_tot_proj_bgt_hrs__c= currentRecord.SumTotal_Proj_Mgt_of_tot_proj_bgt_hrs__c;
      newRecord.SumTotal_STS_Staffing_Gaps__c= currentRecord.SumTotal_STS_Staffing_Gaps__c;
      newRecord.SumTotal_3rd_Party_Resources__c= currentRecord.SumTotal_3rd_Party_Resources__c;
      newRecord.Project_Scope_definition_days__c= currentRecord.Project_Scope_definition_days__c;
      newRecord.RD_Total_deal_contingency__c= currentRecord.RD_Total_deal_contingency__c;
      newRecord.Project_Methodology__c= currentRecord.Project_Methodology__c;
      newRecord.Project_ST_Project_Experience__c= currentRecord.Project_ST_Project_Experience__c;
      newRecord.Project_Education__c= currentRecord.Project_Education__c;
      newRecord.Conversion_Dataconversion_responsibility__c = currentRecord.Conversion_Dataconversion_responsibility__c ;
      /**If( newRecord.CreatedById = newRecord.User__c){
      
      //newRecord.User__c =  currentRecord.User__c  ;
      }   **/ 
    }
    
     public PageReference cloneRecord()
    {
        //Variable to hold the new record
        
        Savepoint sp = Database.setSavepoint();
        
          try
        {
        }catch(Exception e){
         Database.rollback(sp);
            ApexPages.addMessages(e);
       return null;
     } 
 
        return new PageReference('/'+newRecord.id);
  }
}


Custom Clone Button:-
-------------------------------
 /apex/OpportuintyDealClone?id={!Opportunity_Deal_Risk_Assessment__c.Id}

Thanks
samUser-added image
SonamSonam (Salesforce Developers) 
Did you try setting debug log for the user and check if it shows something more in the logs?
If yes, please paste the logs here..