You need to sign in to do that
Don't have an account?
NikunjVadi
get record id of saved data for page reference
I want to save current record and want id of that saved record to pass through to page reference . My controller is:
public HomeEvaluationController (ApexPages.StandardController sc)
{
myCustomObject = (HomeEvaluation__c) sc.getRecord();
controller=sc;
}
public PageReference New_form_save()
{
controller.save();
pageid=myCustomObject.Id;
Pagereference ref = new Pagereference('/apex/Ventilation_Ducting?id='+pageid);
ref.setRedirect(true);
return ref;
}
I am getting null value in page id , please help me out
public HomeEvaluationController (ApexPages.StandardController sc)
{
myCustomObject = (HomeEvaluation__c) sc.getRecord();
controller=sc;
}
public PageReference New_form_save()
{
controller.save();
pageid=myCustomObject.Id;
Pagereference ref = new Pagereference('/apex/Ventilation_Ducting?id='+pageid);
ref.setRedirect(true);
return ref;
}
I am getting null value in page id , please help me out
You can refer below code:
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal
All Answers
You can refer below code:
If this solves your problem, kindly mark it as the best answer.
Thanks,
Vatsal