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
iyappan kandasamy 4iyappan kandasamy 4 

on successfull login redirect to new vf page

Hi ,

I am having one user object there having username and password. 
In one vf page i am having username field and password field . Oncve filling ythe username and password if click on login button then i want to redirect to oyher page if ita a successfull login .

please find the below code and help on this

VF PAGE
<apex:page controller="uloginController" showHeader="false" sidebar="false" standardStylesheets="true">
<apex:form >
<p><b>Login Page</b><br /></p>

    <apex:outputPanel id="getInput" rendered="{!getInput}">
    <p><b>UserName</b><br/>
    <apex:inputText required="true" id="username" styleClass="form-control" value="{!userName}"/></p>
    <p><b>Password</b><br/>
    <apex:inputSecret required="true" id="password" styleClass="form-control" value="{!password}" /></p>
    
    <apex:commandButton value="Login" styleClass="btn btn-success btn-sm" action="{!searchUserName}" />
    <apex:outputText >{!ischeck}</apex:outputText>
    <apex:commandButton value="ClearButton" onclick="this.form.reset();return false;" />

    <apex:outputLink > ForgetPassword<br/></apex:outputLink>
    <apex:outputLink value="https://c.ap5.visual.force.com/apex/NewUserLogin"> Create new Account<br/></apex:outputLink>
    </apex:outputPanel>
    
      <apex:outputText >{!ischeck}</apex:outputText> 
   

</apex:form>
</apex:page>

CONTROLLER

public with sharing class uloginController {
    public String userName {get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
     public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public uloginController() {
       getInput = True;
        ObjList = new List<User__c>();
    }
    public void searchUserName() {
       getInput = False;
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        if(!ObjList.isEmpty()){
            ischeck = true;
        }else{
            ischeck = false;
        }
    }
}
Abdul KhatriAbdul Khatri
public void searchUserName() {
       getInput = False;
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        if(!ObjList.isEmpty()){
            ischeck = true;
            PageReference page = new PageReference('/apex/vfpagename');
            return page.setRedirect(true);
        }else{
            ischeck = false;
}

 
iyappan kandasamy 4iyappan kandasamy 4
Hi Abdul....Thanks a lot for the reply and the answer....and it is working fine....But I have modified slightly my code...and the code is
public with sharing class uloginController {
    public String userName {get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
     public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public uloginController() {
       getInput = True;
        ObjList = new List<User__c>();
    }
    public PageReference searchUserName() {
       getInput = False;
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        if(!ObjList.isEmpty()){
           ischeck = true;
            PageReference page = new PageReference('/apex/registration');
            return page.setRedirect(true);

        }else{
            ischeck = false;
            return null;
        }
    }
}
iyappan kandasamy 4iyappan kandasamy 4
Hi Abdul
If it is First time user, then the above code is correct , but now if the user is already existing candidate I want to only view/edit/save his profile.
Please guide me on the changes in the above code for my scenario. Thanks in advance.
It would be great if u please help on this. Thanks
Abdul KhatriAbdul Khatri
Please share some schema like Registration etc.

I believe after Registration you may be storing his/her profile details to some other custom object or if you can tell me what you do after the Registration process is done. Whatever you do you can do something in the code as metion below with the comments
 
public PageReference searchUserName() {
 	getInput = False;
	ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
	if(!ObjList.isEmpty()){
		ischeck = true;
        
        PageReference page = null;
        //Check here if the user already registered
        //If (Registered)
        //	page = new PageReference('/apex/<vfpage>') ;
        //else
			page = new PageReference('/apex/registration');

        return page.setRedirect(true);
	}else{
		ischeck = false;
        return null;
	}
}

 
Abdul KhatriAbdul Khatri
Based on what you mentioned about another table "registration". Persuming as a Custom Object "Registration__c" and persuming it is a lookup relationship field by the name User__c, here is the code 
 
public PageReference searchUserName() {
 	getInput = False;
	ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
	if(!ObjList.isEmpty()){
		ischeck = true;
        
        PageReference page = null;
        
        List<Registration__c> registerList = [SELECT Id FROM Registration__c WHERE User__c = :ObjList.get(0).Id];
		if(!registerList.isEmpty())        
        //	page = new PageReference('/apex/<vfpage>') ;
      //else
			page = new PageReference('/apex/registration');

        return page.setRedirect(true);
	}else{
		ischeck = false;
        return null;
	}
}

 
iyappan kandasamy 4iyappan kandasamy 4
Hi Abdul, Thanks a lot ...Really Great...Woking fine...It would be great if you please guide me on the below 3 issues also...Please...thanks...

And one more guidance needed from you.

In the registration form and in the Edit profile form...I have a field "Job descirtion" and another custom object "JobRecruiter" also I having the field "Job description", so if the both the job description matches(Eg: in the registration & Edit profile "Job descirtion" =Salesforce and in the jobrecruiter also job description = Salesforce)then the candidate is sheduled for interview and it has to go Interview confirmation Page.Please guide me on this....Thanks.

And 
in the below apex class code ...Only first time the valid login user will come to registration page else go to edit/profile page.
public  with sharing class uloginController
{
    public String userName{get; set;}
    public String RegName{get;set;}
    public String rskill{get;set;}
    public String pskill{get;set;}
    public String EditPName{get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
     public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public List<Registration__c> Reg{get;set;} 
    public List<EditProfile__c> prf{get;set;}
    public uloginController() {
       getInput = True;
        ObjList = new List<User__c>();
    }
    public PageReference searchUserName() {
       getInput = False;
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        
        prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];
        if(!ObjList.isEmpty())
        {
           ischeck = true;
            //PageReference page = new PageReference('/apex/registration');
            //return page.setRedirect(true);
            PageReference page = null;
            //Reg = [SELECT Id, Name,SkillSet__c FROM Registration__c  WHERE Name =: RegName and SkillSet__c=:rskill];
            List<Registration__c> Reg = [SELECT Id FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id];
            if(!Reg.isEmpty())
            //if(userName==RegName)
            {
                  page = new PageReference('/apex/EditProfile');
                 return page.setRedirect(true);
            }
               else
               {
                   page= new PageReference('/apex/registration');
                   return page.setRedirect(true);
               }      
            
        }else{
            ischeck = false;
            userName = '';
            password = '';
            return null;
        }        
    }    
}

So please tell me in the above same apex class what modifications I have to do for both the above requirements. ...Thanks in Advance.

and also in the below visual force page code...Im trying to do "User Name" and "Password" as the required fields and I have written the 
javascript validation but it is not working ...So, please guide me on this also please...


<apex:page controller="uloginController" showHeader="false" sidebar="false" standardStylesheets="true">
<script type= "text/javascript">
function validate()
{
 
if(document.getElementById('{!$Component.username}').value=='')
{
alert("User Name is Mandatory");
}
}
</script>
 
<apex:form >
<!--<p><b>Login Page</b><br /></p>-->
<apex:pageBlock title="Login Page - Welcome TO Online Job Portal">
 
<apex:pageBlockSection >
  <table>
  <tr>
  <td>
 
    <!--<apex:outputPanel id="getInput" rendered="{!getInput}">-->
 
    <p><b>UserName</b><br/>
    <apex:inputText id="username" styleClass="form-control" value="{!userName}" /></p>
    <!--</apex:outputPanel>-->
  </td>
  </tr>
  <tr>
  <td>
 
     <p><b>Password</b><br/>
    <apex:inputSecret id="password" styleClass="form-control" value="{!password}" /></p>
  </td>
  </tr> 
  </table>
 
 </apex:pageBlockSection>  
     <!--<apex:pageblockbuttons >-->
    
     <!--<apex:commandButton value="Login" styleClass="btn btn-success btn-sm" rerender="getInput" action="{!searchUserName}" onclick="validate();" />-->
    
          
     <apex:commandButton value="ClearButton" onclick="this.form.reset();" />
    
     <apex:outputLink > ForgetPassword<br/></apex:outputLink>
    
     <apex:outputLink value="https://c.ap5.visual.force.com/apex/NewUserLogin"> Create new Account<br/></apex:outputLink>
    
     <!--</apex:outputPanel>-->
      <!--</apex:pageblockbuttons>-->
  
 
 
</apex:pageBlock>
</apex:form>
</apex:page>



Please guide me in the above issues ...please
thanks in advance...





 
Abdul KhatriAbdul Khatri
on what field do I match JobRecruiter custom object with?
iyappan kandasamy 4iyappan kandasamy 4
Hi In the jobrecruiter custom object match with the field skillet.thanks Sent from Yahoo Mail on Android
Abdul KhatriAbdul Khatri
Her you go, I made little refactoring in the controller keeping the same concept as per you need but little better way.

Controller
public  with sharing class uloginController
{
    public String userName{get; set;}
    public String RegName{get;set;}
    public String rskill{get;set;}
    public String pskill{get;set;}
    public String EditPName{get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
    public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public List<Registration__c> Reg{get;set;} 
    public List<EditProfile__c> prf{get;set;}

    public uloginController() {
        getInput = True;
        ObjList = new List<User__c>();
    }
    
    public PageReference searchUserName() {
        getInput = False;
        
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        
        prf = [SELECT Id, Name,SkillSet__c, JobDescription__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];
        if(!ObjList.isEmpty())
        {
            ischeck = true;
            PageReference page = null;

            List<Registration__c> Reg = [SELECT Id, JobDescription__c FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id];
            if(Reg == null) 
                page= new PageReference('/apex/registration');
                
            List<JobRecruiter__c> jobRec = [SELECT Id, JobDescription__c FROM JobRecruiter__c WHERE SkillSet__c=:pskill];
            if(page == null && !jobRec.isEmpty() && prf.JobDescription__c == 'Salesforce' && prf.JobDescription__c == Reg.JobDescription__c && Reg.JobDescription__c == jobRec.JobDescription__c)          
                page = new PageReference('/apex/<ConfirmationPage>');
            
            if(page == null)
                page = new PageReference('/apex/EditProfile');

            return page.setRedirect(true);
           
        }else{
            ischeck = false;
            userName = '';
            password = '';
            return null;
        }        
    } 
      
}



Visualforce page
<apex:page controller="uloginController" showHeader="false" sidebar="false" standardStylesheets="true">
<script type= "text/javascript">
function validate() {

    if(document.getElementById('j_id0:frmlogin:j_id28:j_id29:username').value=='') {
        alert("User Name is Mandatory");
        return false;
    }

    if(document.getElementById('j_id0:frmlogin:j_id28:j_id29:password').value=='') {
        alert("Password is Mandatory");
        return false;
    }
    
    return true;
}
</script>
 
<apex:form id="frmlogin">
<apex:pageMessages />
<!--<p><b>Login Page</b><br /></p>-->
<apex:pageBlock title="Login Page - Welcome TO Online Job Portal">
    <apex:pageBlockSection >
        <table>
            <tr>
                <td>                
                    <!--<apex:outputPanel id="getInput" rendered="{!getInput}">-->
                    <p><b>UserName</b><br/>                     
                    <apex:outputPanel styleClass="requiredInput" layout="block">
                    <apex:outputPanel styleClass="requiredBlock" layout="block"/>                                                        
                        <apex:inputText id="username" styleClass="form-control" value="{!userName}" required="true" />
                        <!--</apex:outputPanel>-->
                    </apex:outputPanel>
                    </p>                    
                </td>
            </tr>
            <tr>
                <td>
                    <p><b>Password</b><br/>
                    <apex:outputPanel styleClass="requiredInput" layout="block">
                    <apex:outputPanel styleClass="requiredBlock" layout="block"/>                     
                        <apex:inputSecret id="password" styleClass="form-control" value="{!Password}" required="true" />
                    </apex:outputPanel>                        
                    </p>
                </td>
            </tr> 
        </table>
    </apex:pageBlockSection>  
    <!--<apex:pageblockbuttons >-->
    <!--<apex:commandButton value="Login" styleClass="btn btn-success btn-sm" rerender="getInput" action="{!searchUserName}" onclick="validate();" />-->
    <apex:commandButton value="ClearButton" onclick="this.form.reset();return false;" />
    <apex:outputLink > ForgetPassword<br/></apex:outputLink>
    <apex:outputLink value="https://c.ap5.visual.force.com/apex/NewUserLogin" onclick="return validate()" > Create new Account<br/></apex:outputLink>
    <!--</apex:outputPanel>-->
    <!--</apex:pageblockbuttons>-->
</apex:pageBlock>
</apex:form>
</apex:page>

 
iyappan kandasamy 4iyappan kandasamy 4

Thanks Abdul For your response...But in the apex class I'm getting error as "Variable does not exits" and even i tried to rectify it but no response...

So the tables what I have is 


Table Name:Registration
Field1:Name
Field2:SkillSet__c(this is the job description field)

Table2 Name:EditProfile
Field1:Name
Field2:SkillSet__c(this is the job description field)

Table3 Name:JobRecruiter__c
Field1:Name
Field2:SkillSet__c(this is the job description field)


So in all the 3 tables if the field "Skillset"(i.e. the job description) matches then the candidate is selected for Interview else rejected. Please can u help me out the changes in the above same apex class please....thanks.

public  with sharing class uloginController
{

    public String userName{get; set;}

    public String RegName{get;set;}

    public String rskill{get;set;}

    public String pskill{get;set;}

    public String EditPName{get; set;}

    public String password {get; set;}

    public Boolean getInput {get;set;}

    public Boolean ischeck {get;set;}

    public List<User__c> ObjList{get; set;}

    public List<Registration__c> Reg{get;set;}

    public List<EditProfile__c> prf{get;set;}
    
    List<JobRecruiter__c> jobRec{get;set;}

 

    public uloginController() {

        getInput = True;
        
        ObjList = new List<User__c>();

    }    

    public PageReference searchUserName() 
    {
        getInput = False;

        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];

        prf = [SELECT Id, Name,SkillSet__c, JobDescription__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];

        if(!ObjList.isEmpty())

        {

            ischeck = true;

            PageReference page = null;

            List<Registration__c> Reg = [SELECT Id, JobDescription__c FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id];

            if(Reg == null)//For the first time login user 

                page= new PageReference('/apex/registration');
                

            List<JobRecruiter__c> jobRec = [SELECT Id, JobDescription__c FROM JobRecruiter__c WHERE SkillSet__c=:pskill];

            if(page == null && !jobRec.isEmpty() && prf.JobDescription__c == 'Salesforce' && prf.JobDescription__c == Reg.JobDescription__c && Reg.JobDescription__c == jobRec.JobDescription__c)         

                page = new PageReference('/apex/InterviewConfirmationPage');

             

            if(page == null)

                page = new PageReference('/apex/EditProfile');

 

            return page.setRedirect(true);

            

        }else{

            ischeck = false;

            userName = '';

            password = '';

            return null;

        }       

    }

       

}







 
Abdul KhatriAbdul Khatri
SkillSet__c is a Text Field right with a value = "Salesforce" or it is a referece from any other Custom Object (Please specify that object if it is)
Abdul KhatriAbdul Khatri
Presuming SkillSet__c is a Text Fiedl with the value "Salesforce", here is the code
 
public  with sharing class uloginController
{
    public String userName{get; set;}
    public String RegName{get;set;}
    public String rskill{get;set;}
    public String pskill{get;set;}
    public String EditPName{get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
    public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public List<Registration__c> Reg{get;set;} 
    public List<EditProfile__c> prf{get;set;}

    public uloginController() {
        getInput = True;
        ObjList = new List<User__c>();
    }
    
    public PageReference searchUserName() {
        getInput = False;
        
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        
        prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];
        if(!ObjList.isEmpty())
        {
            ischeck = true;
            PageReference page = null;

            List<Registration__c> Reg = [SELECT Id, SkillSet__c  FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id];
            if(Reg == null) 
                page= new PageReference('/apex/registration');
                
            List<JobRecruiter__c> jobRec = [SELECT Id, SkillSet__c  FROM JobRecruiter__c WHERE SkillSet__c=:rskill];
            if(page == null && !jobRec.isEmpty() && prf.SkillSet__c  == 'Salesforce' && prf.SkillSet__c  == Reg.SkillSet__c c && Reg.SkillSet__c  == jobRec.SkillSet__c )          
                page = new PageReference('/apex/<ConfirmationPage>');
            
            if(page == null)
                page = new PageReference('/apex/EditProfile');

            return page.setRedirect(true);
           
        }else{
            ischeck = false;
            userName = '';
            password = '';
            return null;
        }        
    } 
      
}

 
iyappan kandasamy 4iyappan kandasamy 4
Hi..Abdull..SkillSet__c is a normal text field only...but still Im getting the error as "Error: Compile Error: Variable does not exist: SkillSet__c at line 67 column 58"....please guide me on this...I have pasted the same code....thanks a lot for your time investment....Thanks
Abdul KhatriAbdul Khatri
I don't see line 67 in my Code, Can you please check the case of SkillSet__c field if it is not Skillset__c. If you don't mind can you please share the schema of three objects
iyappan kandasamy 4iyappan kandasamy 4
User-added image
hi
this is the schema of my objects.Any suggestions please. And also in the above code line number 36....that is in the line 
"if(page == null && !jobRec.isEmpty() && prf.SkillSet__c == 'Salesforce' && prf.SkillSet__c == Reg.SkillSet__c c && Reg.SkillSet__c == jobRec.SkillSet__c )"  ......I copied the fields straightly...into the code so no case issues. Please any suggestions and guidance from you.. thanks
Abdul KhatriAbdul Khatri
I see a small issue in this if statement, an extra ”c” please remove that

Reg.SkillSet__c && Reg.SkillSet__c == jobRec.SkillSet__c )" 
iyappan kandasamy 4iyappan kandasamy 4
Hi Abdul, Even I removed that and I checked..but still the same issue...Please guide me...thank
Abdul KhatriAbdul Khatri
Please share the actual error, screen shot, log etc.
Abdul KhatriAbdul Khatri
Try this 
 
public  with sharing class uloginController
{
    public String userName{get; set;}
    public String RegName{get;set;}
    public String rskill{get;set;}
    public String pskill{get;set;}
    public String EditPName{get; set;}
    public String password {get; set;}
    public Boolean getInput {get;set;}
    public Boolean ischeck {get;set;}
    public List<User__c> ObjList{get; set;}
    public List<Registration__c> Reg{get;set;} 
    public List<EditProfile__c> prf{get;set;}

    public uloginController() {
        getInput = True;
        ObjList = new List<User__c>();
    }
    
    public PageReference searchUserName() {
        getInput = False;
        
        ObjList = [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];
        
        prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];
        if(!ObjList.isEmpty())
        {
            ischeck = true;
            PageReference page = null;

            List<Registration__c> Reg = [SELECT Id, SkillSet__c  FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id];
            if(Reg == null) 
                page= new PageReference('/apex/registration');
                
            List<JobRecruiter__c> jobRec = [SELECT Id, SkillSet__c  FROM JobRecruiter__c WHERE SkillSet__c=:pskill];
            if(page == null && !prf.isEmpty() && !jobRec.isEmpty() 
                    && prf.get(0).SkillSet__c  == 'Salesforce' 
                    && prf.get(0).SkillSet__c  == Reg.get(0).SkillSet__c 
                    && Reg.get(0).SkillSet__c  == jobRec.get(0).SkillSet__c )          
                page = new PageReference('/apex/<ConfirmationPage>');
            
            if(page == null)
                page = new PageReference('/apex/EditProfile');

            return page.setRedirect(true);
           
        }else{
            ischeck = false;
            userName = '';
            password = '';
            return null;
        }        
    } 
      
}

 
iyappan kandasamy 4iyappan kandasamy 4
Questions
1.I have a new user ,so it goes to New Registration form and get saved , now how to get this Registrations user to the main User table?
2.In my apex class, i have written code for insert(saving) ,when the name is saved it is getting saved but when i m giving the same name 
  it is throwing error and again the name is getting saved?
   or the same second question ,How to remove duplicates...that is the apex class should not allow the duplicates?
3.Want to bring the job recruiters records as a picklist in the edit profile page Eg: Job Recruiter Name:TCS and Skill set = Java. in the visual force page from another object
  and then do comparison.....so,then my skillset and TCS skillset matches then the candidate is scheduled for interview.
 
iyappan kandasamy 4iyappan kandasamy 4
Please guide me with the above questions...and thanks for your time investment for the above solution...Please guide me....thank..

Im using the above same code 


public  with sharing class uloginController
{

    public String userName{get; set;}

    public String RegName{get;set;}

    public String rskill{get;set;}

    public String pskill{get;set;}
    
    public String jrskill{get;set;}

    public String EditPName{get; set;}

    public String password {get; set;}

    public Boolean getInput {get;set;}

    public Boolean ischeck {get;set;}

    public List<User__c> ObjList{get; set;}

    public List<Registration__c> Reg{get;set;}

    public List<EditProfile__c> prf{get;set;}
    
    public List<JobRecruiter__c> jobRec{get;set;}

 

    public uloginController() {

        getInput = True;
        
        ObjList = new List<User__c>();

    }    
    
    //Code For saving the new registration record
    Registration__c rg=new Registration__c();
    public Registration__c getrg()
    {
    return rg;
    }
    public PageReference save()
    {
    insert rg;     
    return null;
    }
    
    //Code For saving the EditProfile record
    EditProfile__c ep=new EditProfile__c();
    public EditProfile__c getep()
    {
    return ep;
    }
    public PageReference save1()
    {
    insert ep;    
    return null;
    }



    public PageReference searchUserName() 
    {
        getInput = False;

        ObjList= [SELECT Id, Name,Password__c FROM User__c  WHERE Name =: userName];

        //prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];
        prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName];

        if(!ObjList.isEmpty())

        {

            ischeck = true;

            PageReference page = null;

            List<Registration__c> Reg = [SELECT Id, SkillSet__c FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id and SkillSet__c=:rskill];
            
            //Registration__c[] Reg = [SELECT Id, SkillSet__c FROM Registration__c WHERE RegisterUser__c = :ObjList.get(0).Id and SkillSet__c=:rskill];
 
            if(Reg == null)//For the first time login user 

                page= new PageReference('/apex/registration');
                

            List<JobRecruiter__c> jobRec= [SELECT Id, SkillSet__c FROM JobRecruiter__c WHERE SkillSet__c=:jrskill];
            
            //JobRecruiter__c[] jobRec= [SELECT Id, SkillSet__c FROM JobRecruiter__c WHERE SkillSet__c=:pskill];
            
            //prf = [SELECT Id, Name,SkillSet__c FROM EditProfile__c  WHERE Name =: EditPName and SkillSet__c=:pskill];

            if(page == null && !jobRec.isEmpty() && prf.get(0).SkillSet__c == Reg.get(0).SkillSet__c && Reg.get(0).SkillSet__c == jobRec.get(0).SkillSet__c)         

                page = new PageReference('/apex/InterviewConfirmationPage');

             

            if(page == null)

                page = new PageReference('/apex/EditProfile');

 

            return page.setRedirect(true);

            

        }else{

            ischeck = false;

            userName = '';

            password = '';

            return null;

        }       

    }

       

}.


Visual force pages
-----------------------

<apex:page controller="uloginController" showHeader="false" sidebar="false" standardStylesheets="true" action="{!autoRun}" >
  <apex:form >
  <apex:pageBlock title="Welcome to Edit Profile Form">
  <apex:pageBlockSection >
  <table>
  <tr>
  <td>  
  <apex:inputText required="true" id="Name" styleClass="form-control" value="{!ep.Name}"/>
  </td>
  </tr>
  
  
  
  <tr>
  <td>  
  <apex:inputText required="true" id="SkillSet" styleClass="form-control" value="{!ep.SkillSet__c}"/>
  </td>
  </tr>
  
  <tr>
  <td>  
  
  <apex:inputText required="true" id="JobRecruiterName" styleClass="form-control"  value="{!ep.JobRecruiterName__c}"/>
  </td>
  </tr>
  
  
  
  </table>
  </apex:pageBlockSection>
  <apex:commandButton value="save" action="{!save1}"/>
  </apex:pageBlock>
  </apex:form>
</apex:page>
Abdul KhatriAbdul Khatri
Sorry I got busy with my work. Was working on a big deployment. I am done will try to help you out onwards.

One question, Is this a project you are working on? It seems you need a complete flow of user management for some portal. This forum might not be for that. Let me know if we can chat differently so that we can achieve you goal and I better help you properly.
iyappan kandasamy 4iyappan kandasamy 4
Hi Abdul, thanks for your response..I got answers for the questions which I have asked you above....but now the issue  is...I have a requirement...1) when I click on the custom button in a custom object( order) it has to navigate me to the  page layout 1 of another object ( credit card)... Please it would be great if  can you help me out in configuration of the requirement in steps please.. thanks in advance..and thanks for your time investment.... Sent from Yahoo Mail on Android