You need to sign in to do that
Don't have an account?
Fabian Paul 6
I m new to salesforce and can't find what this Page refers to in this code...is it a class or something else...?
public PageReference save() {
PageReference p = null;
if (this.qp == null || !'yyyy'.equals(this.qp)) {
p = Page.failure;
p.getParameters().put('error', 'noParam');
} else {
try {
Lead newlead = new Lead(LastName=this.lastName,
FirstName=this.firstName;
Company=this.company,
Email=this.email)
insert newlead;
} catch (Exception e) {
p = Page.failure;
p.getParameters().put('error', 'noInsert');
}
}
if (p == null) {
p = Page.success;
}
p.setRedirect(true);
return p;
}
PageReference p = null;
if (this.qp == null || !'yyyy'.equals(this.qp)) {
p = Page.failure;
p.getParameters().put('error', 'noParam');
} else {
try {
Lead newlead = new Lead(LastName=this.lastName,
FirstName=this.firstName;
Company=this.company,
Email=this.email)
insert newlead;
} catch (Exception e) {
p = Page.failure;
p.getParameters().put('error', 'noInsert');
}
}
if (p == null) {
p = Page.success;
}
p.setRedirect(true);
return p;
}
Mark as best answer, If it resloves !! here you are making cretria to enter into loop, if satisfies above condtion getting error
if it is not satisfing you are creating a new lead
then these is page refernce happing on Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com/)
p = Page.success;
In sfdc Page reference is nothing but VisualForce components which acts like UI page.
you can navigate to setup->visualforec pages-> success
Regards,
Pawan Kumar