• San India
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
Hi All,

I have used REST API with cURL to insrert Accounts in Salesforce using PHP, for that i have created one Salesforce Connected App with oAuth and used Consumer Key and Consumer Secret to connect, But when i try to insert record from PHP , Every time redirecting to salesforce Login page after successfull login records are inserting into Salesforce

oAuth with coneceted App evrytime forcing to login

If end user knows the Salesforce credentials he can directly login into salesforce and insert Account record what is the use of Integration

Please help me on this , How can i connect Salesforce without login page and directly insert records
Hi Friends
i have used below link instructions to integrate php with salesforce with rest API
http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php
it is working fine but every time asking for login to salesforce 
i want to access this api without login page 
any one can help me on this
Hi All,

I have a requirement like
1st need to search all accounts with matching text from textbox and result need to show in dropdown in VF Page and (this is done)
again from dropdown any account selected need to search that account contacts ans show as table in same VF page (not done getting error) like

Visualforce Error
Help for this Page
System.NullPointerException: Attempt to de-reference a null object
Class.accountListDropdown.getacctContact: line 41, column 1

here is my code VF Page

<apex:page controller="accountListDropdown" >
  <apex:form >
  
  <apex:outputlabel >Enter Account Name : </apex:outputlabel>
  <apex:inputtext value="{!accountname}" />
  <apex:commandButton action="{!getSearchedAccts}" value="Go.."/>
  
  <apex:pageBlock >
      <apex:pageblockTable value="{!actList}" var="act" rendered="{!actList != null}">
          <apex:column value="{!act.Id}"/>
          <apex:column value="{!act.Name}"/>
      </apex:pageblockTable>
  
    <apex:pageblocksection >
        <apex:outputlabel >Select Account Name to get Contacts: </apex:outputlabel> 
        <apex:selectList id="actOptions" value="{!actOptions}" size="1" rendered="{!actList != null}">
         <apex:actionSupport event="onchange" action="{!accounContacts}" />
            <apex:selectOptions value="{!items}"/>
        </apex:selectList>  
    </apex:pageblocksection>
    
     <apex:pageblockTable value="{!acctContact}" var="cont" rendered="{!actList != null} && {!acctContact != null}">
      <apex:column value="{!cont.Id}"/>
      <apex:column value="{!cont.Name}"/>
    </apex:pageblockTable>
      
  </apex:pageBlock>
  </apex:form>
</apex:page>

My Controller

public class accountListDropdown { 
    public String accountname { get; set; }    
    public list<Account> actList { get; set; }  
    public list<Contact> contactList { get; set; }   
    public String actOptions { get; set; }
    public accountListDropdown(){

    }     
    public pageReference getSearchedAccts() {
        actList = new list<Account>();
        //system.debug('SELECT Id,Name FROM Account WHERE Name Like' +'%'+ accountname +'%');
        string tempInput = '%' + accountname  + '%';
        actList = [SELECT Id,Name FROM Account WHERE Name Like : tempInput];     
        return null;
    }
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();       
        if(!actList.isEmpty()){
            for(Account c : actList){
                options.add(new SelectOption(c.Id, c.Name));
            }
        }             
        return options;
    }   
    public PageReference accounContacts() {
        contactList = new list<Contact>();
        
        
        contactList = [SELECT  Id,Name FROM Contact WHERE AccountId =  : actOptions];   
        system.debug(contactList); 
        return null;
    }
    public List<Contact> getacctContact() {
    
        contactList = new list<Contact>();
        
        
        contactList = [SELECT  Id,Name FROM Contact WHERE AccountId =  : actOptions];   
    
        List<Contact> actContatsData = new List<Contact>();         
        if(!actList.isEmpty() && !contactList.isEmpty()){
            for(Contact c : contactList){
                actContatsData.add(c);
            }
        }             
        return actContatsData;
    }
}
 please any one help on this
Hi Friends,

I have a requirement with 2 record types
when i choose X record type it should display opportunity standard page 
when i choose Y record type it should display VF Page with opportunity mandatory fields  

unable to do this , can any one help on this

Thanks
Hi All,

I have a requirement like
1st need to search all accounts with matching text from textbox and result need to show in dropdown in VF Page and (this is done)
again from dropdown any account selected need to search that account contacts ans show as table in same VF page (not done getting error) like

Visualforce Error
Help for this Page
System.NullPointerException: Attempt to de-reference a null object
Class.accountListDropdown.getacctContact: line 41, column 1

here is my code VF Page

<apex:page controller="accountListDropdown" >
  <apex:form >
  
  <apex:outputlabel >Enter Account Name : </apex:outputlabel>
  <apex:inputtext value="{!accountname}" />
  <apex:commandButton action="{!getSearchedAccts}" value="Go.."/>
  
  <apex:pageBlock >
      <apex:pageblockTable value="{!actList}" var="act" rendered="{!actList != null}">
          <apex:column value="{!act.Id}"/>
          <apex:column value="{!act.Name}"/>
      </apex:pageblockTable>
  
    <apex:pageblocksection >
        <apex:outputlabel >Select Account Name to get Contacts: </apex:outputlabel> 
        <apex:selectList id="actOptions" value="{!actOptions}" size="1" rendered="{!actList != null}">
         <apex:actionSupport event="onchange" action="{!accounContacts}" />
            <apex:selectOptions value="{!items}"/>
        </apex:selectList>  
    </apex:pageblocksection>
    
     <apex:pageblockTable value="{!acctContact}" var="cont" rendered="{!actList != null} && {!acctContact != null}">
      <apex:column value="{!cont.Id}"/>
      <apex:column value="{!cont.Name}"/>
    </apex:pageblockTable>
      
  </apex:pageBlock>
  </apex:form>
</apex:page>

My Controller

public class accountListDropdown { 
    public String accountname { get; set; }    
    public list<Account> actList { get; set; }  
    public list<Contact> contactList { get; set; }   
    public String actOptions { get; set; }
    public accountListDropdown(){

    }     
    public pageReference getSearchedAccts() {
        actList = new list<Account>();
        //system.debug('SELECT Id,Name FROM Account WHERE Name Like' +'%'+ accountname +'%');
        string tempInput = '%' + accountname  + '%';
        actList = [SELECT Id,Name FROM Account WHERE Name Like : tempInput];     
        return null;
    }
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();       
        if(!actList.isEmpty()){
            for(Account c : actList){
                options.add(new SelectOption(c.Id, c.Name));
            }
        }             
        return options;
    }   
    public PageReference accounContacts() {
        contactList = new list<Contact>();
        
        
        contactList = [SELECT  Id,Name FROM Contact WHERE AccountId =  : actOptions];   
        system.debug(contactList); 
        return null;
    }
    public List<Contact> getacctContact() {
    
        contactList = new list<Contact>();
        
        
        contactList = [SELECT  Id,Name FROM Contact WHERE AccountId =  : actOptions];   
    
        List<Contact> actContatsData = new List<Contact>();         
        if(!actList.isEmpty() && !contactList.isEmpty()){
            for(Contact c : contactList){
                actContatsData.add(c);
            }
        }             
        return actContatsData;
    }
}
 please any one help on this