function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fabian Paul 6Fabian 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;
            }
bhanu_prakashbhanu_prakash
Hi Paul,
Mark as best answer, If it resloves !!​
this.qp == null || !'yyyy'.equals(this.qp)
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
Lead newlead = new Lead(LastName = this.lastName,
    FirstName = this.firstName; Company = this.company,
    Email = this.email)
insert newlead;

then these is page refernce happing on 
p = Page.success;
}
p.setRedirect(true);
return p;
Mark as resloved if it helps :) :)
Thanks, 
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com/)
PawanKumarPawanKumar
Here you are doing page reference.
     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