You need to sign in to do that
Don't have an account?
URL No Longer Exists
HI,
Under Opportunity i have custom object Role__C.Here if i click on New Role one visual force page will dispaly.i am displaying one field.After entering some value i need save this value under opportunity.But i am getting error as URL No Longer Exists.
Can any one guide me...
Here is my code..
<apex:page controller="TestRole" >
<apex:form >
<apex:pageBlock > <apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
client pin
<apex:inputField value="{!member1.Client_P_N__c}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
apex class:
public class TestRole
{
public Opportunity opp{get;set;}
public TestRole(ApexPages.StandardSetController controller) {
}
public TestRole(ApexPages.StandardController controller) {
r = new Role__c();
}
Public Id I = ApexPages.CurrentPage().getParameters().get('id');
public Role__c r{ get; set;}
public TestRole()
{
}
public PageReference save() {
insert r;
PageReference customer = new PageReference('/'+ApexPages.CurrentPage().getParameters().get('oppid'));
customer.setRedirect(true);
return customer ;
}
}
Thanks...
Hi,
In the page reference method your are using oppid but in the url I think parameter will be id.
So use the id instead of oppid in save method
Try the below code snippet as reference:
public PageReference save() {
insert r;
PageReference customer = new PageReference('/'+ApexPages.CurrentPage().getParameters().get('id'));
customer.setRedirect(true);
return customer ;
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Thanks for ur reply,
Still i am getting same error.
Hi,
Check the parameter name in vf page url.exactly what is this coming oppid or id??
in visualforce page it is dispalying Opportunity id .
In constructor also i need to query opportunity i think.i used there also..
Still it is not coming