You need to sign in to do that
Don't have an account?
profile_name
'URL No Longer Exists' error during Insert operation
I have a controller extension for a custom object where I am trying to insert a record according to input from selectCheckbox. I am getting 'URL No Longer Exists' and am unable to debug this or find out what is going wrong.
Markup:
<apex:page standardcontroller="Equipment_Type__c" extensions="addMakesController1"> <apex:pageBlock id="pageBlock1"> <apex:pageBlockTable value="{!usedMakes}" var="ma" style="width:20px"> <apex:column headerValue="Action"> <apex:form > <apex:commandlink action="{!delMake}">Del</apex:commandlink> </apex:form> </apex:column> <apex:column value="{!ma.name}" /> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock id="pageBlock2"> <apex:form > <apex:selectCheckboxes value="{!selectedMakes}" style="float:left" layout="PageDirection" > <apex:selectOptions value="{!validMakes}" /> </apex:selectCheckboxes><br/> </apex:form> </apex:pageBlock> <apex:form > <apex:commandButton action="{!addMakes}" value="Add selected Makes" rerender="pageBlock1,pageBlock2" status="updateStatus"/> <apex:actionStatus startText="Please wait..." stopText="Records updated successfully" id="updateStatus" /> </apex:form> </apex:page>
Controller:
public with sharing class addMakesController1 { private Equipment_Type__c type; public addMakesController1(ApexPages.StandardController controller) { this.type = (Equipment_Type__c)controller.getRecord(); list<Equipment_Type__c> type1=[select id,Functional_Group__r.Id from Equipment_Type__c where id=:this.type.id limit 1]; if(type1.size()!=0) this.type = type1[0]; } public list<Make__c> allMakes=new list<Make__c>(); public list<SelectOption> temp=new list<SelectOption>(); public list<Make__c> displayMakes=new list<Make__c>(); public list<Make__c> getUsedMakes(){ allMakes=[select name from Make__c where Functional_Group__c=:type.Functional_Group__r.Id]; list<Make__c> usedMakes=new list<Make__c>(); for(Make__c m:allMakes){ list<Type_Make__c> tmtemp=new list<Type_Make__c>(); tmtemp=[select id from Type_Make__c where Type__c=:type.id AND Make__c=:m.id]; if(tmtemp.size()!=0){ usedMakes.add(m); } } return usedMakes; } public list<string> selectedMakes{get;set;} public list<SelectOption> getValidMakes(){ allMakes=[select name from Make__c where Functional_Group__c=:type.Functional_Group__r.Id]; list<SelectOption> validMakes=new list<SelectOption>(); for(Make__c m:allMakes){ list<Type_Make__c> tmtemp=new list<Type_Make__c>(); tmtemp=[select id from Type_Make__c where Type__c=:type.id AND Make__c=:m.id]; if(tmtemp.size()==0){ validMakes.add(new SelectOption(m.name,m.name)); } } if(validMakes.size()!=0){ return validMakes; } else{ return null; } } public void delMake(){} public void addMakes(){ list<Type_Make__c> tmList=new list<Type_Make__c>(); for(String m:selectedMakes){ tmList.add(new Type_Make__c(Type__c=type.id,Make__c=[select id,name from Make__c where name=:m].id)); if(tmList.size()!=0)insert tmList; } }
neeedhelp
Can you just debug what value is coming in tmList.Generally this type of Error occurs when a page redirects to URL where that URL doesn't exist in salesforce