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
rvkrvk 

command link is not working

HI,

 

I have developed a login page for the partner portal in that there is a command link "forgot you password" which is not at working below  is the  code.Initially it was working  all of a sudden it was stopped working.Can any one help me.

 

 VF code:

 

 <div>
                  <table border="0" cellpadding="0" cellspacing="0">
                      <tr>
                          <td> <apex:commandLink value="Forgot your password?" action="{!ForgotPasswordLink}"/> </td>
                       </tr>
                  </table>
             </div> 

 

controller  method code :

Global pageReference ForgotPasswordLink (){       
String startURL = ' ';       
if(url.contains('cs')){           
startURL = 'https://tapp0.salesforce.com/secur/forgotpasswordp.jsp';         
  startURL += '?orgId=*************&portalId=**************&loginType=3';
            startURL += '&pLu=%2Fsecur%2Flogin_portal.jsp';          
    }        

else{            
startURL = 'https://na7.salesforce.com/secur/forgotpasswordp.jsp';       
    startURL += '?orgId=*************&portalId=*******************&loginType=3';
           startURL += '&pLu=%2Fsecur%2Flogin_portal.jsp';       
 }                           

pageReference p = new PageReference(startURL);      
 p.setredirect(true);      
 return p;   

 }

 

LabrixLabrix

You can use the built in Password reset feature (for portal users) 

 

Site.forgotPassword(String username)

 

This uses the existing salesforce password reset feature for portal users.

rvkrvk

Thanks for the reply.According to the requirement it should forward to that link.There user enters the user name to get the password.

rvkrvk

The issue was resolved.Thanks