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
surya teja 46surya teja 46 

Page Navigation

hi 
i am a salesforce learner 
I am getting a problem in my code any one give me a guidence 
this is my vf code
=====================
<apex:page standardController="lead" extensions="newfunctionofleads" tabStyle="lead">
  <apex:form >
      <apex:pageBlock >
          <apex:pageBlockButtons location="top">
              <apex:commandButton value="New" action="{!gotoeditpage}"/>
          </apex:pageBlockButtons>
         </apex:pageBlock>
  </apex:form>
</apex:page>

this is my controller:
==============
public with sharing class newfunctionofleads {

    public newfunctionofleads(ApexPages.StandardController controller) 
    }
    public void gotoeditpage()
    {
        list<user> lstusers = [Select id, name, profileid from user];
        
        for(user u: lstusers)
        {
          if(u.profileid == '00e280000028dLaAAI' )
         {
             getvender();
         }
         else if(u.profileid == '00e28000000Z6uZAAS')
         { 
             getadmin();
         }
        }
    } 
    public pagereference getvender()
    {
       pagereference pgref = new pagereference('https://ap2.salesforce.com/00Q/e?retURL=%2F00Q%2Fo');
       return pgref.setredirect(true);  
    }
    
    public pagereference getadmin()
    {
       pagereference pgref = new pagereference('https://ap2.salesforce.com/00Q/e?retURL=%2F00Q%2Fo');
       return pgref.setredirect(true);
    }
}
==========================================
I am created a new button when vendor user hits it, directly vendor record type should open silmilarly with the other user so please help me to over come this problem 
Surendra Choudhary 1Surendra Choudhary 1
Hi Surya,

Can you please let me know exactly what problem you are facing in this code?

Regards,
Surendra
surya teja 46surya teja 46
thank you surendra garu but i got it