+ Reply to Thread
Results 1 to 4 of 4

Thread: Custom Fields search able but not displaying the record

  1. #1
    ch3f is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Custom Fields search able but not displaying the record

    I am trying to do, what I think is, a simple query.

    Select Name, Id, CID__c, Account_Executive__c From Account

    The 2 custom fields I am able to search by them but my php code is not showing the records for those fields. However, I am also using Eclipse with the salesforce IDE plugin and I with the same query it returns the custom fields records.

    Code:
    <?php
    // SOAP_CLIENT_BASEDIR - folder that contains the PHP Toolkit and your WSDL
    // $USERNAME - variable that contains your Salesforce.com username (must be in the form of an email)
    // $PASSWORD - variable that contains your Salesforce.ocm password
    
    define("SOAP_CLIENT_BASEDIR", "soapclient");
    require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
    require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');
    require_once (SOAP_CLIENT_BASEDIR.'/function.php');
    require_once ('userAuth.php');
    ini_set('soap.wsdl_cache_ttl', '15');
    ini_set('soap.wsdl_cache_dir', './wsdl-cache');
    try {
          $mySforceConnection = new SforceEnterpriseClient();
          $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
          $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
          $query = "Select Name, CID__c, BillingCity, Account_Executive__c From Account a limit 20";
          $something = "Select a.Name, a.Id, a.CID__c, a.Account_Executive__c From Account a where CID__c like '125%'";
          $createResponse = $mySforceConnection->query($something);
    
                  echo "<table border=1 cellpadding=2>";
                  echo "<tr>";
                   echo "<th> ID </th>";
                   echo "<th> Name </th>";
                   echo "<th> CID </th>";
                   echo "<th> Account Executive </th>";
                   echo "</tr>";
    
    foreach ($createResponse as $createResult){
    //print_r($createResponse);
        //print("<br>");
        for ($i=0, $num_result=count($createResult); $i < $num_result; $i++){
            echo "<tr>";
              echo "<td>";
                print($createResult[$i]-> Id);
            echo "</td>";
            echo "<td>";    
                print($createResult[$i]-> Name );
            echo "</td>";
            echo "<td>";
                print($createResult[$i]-> CID__c );
            echo "</td>";
            echo "<td>";
                print($createResult[$i]-> Account_Executive__c );
            echo "</td>";
            echo "</tr";
       }
    }
               echo "<table border=\"1\">";
    } catch (Exception $e) {
      echo $mySforceConnection->getLastRequest();
      echo "</br>";
      echo "<h1>faultstring:</h1> </br>";
      echo $e->faultstring;
      echo "</br>";
      return $return;
    
    }
    ?>
    Any help would be greatly appreciated

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    557
    Blog Entries
    15
    ch3f,

    Sorry for the delay in looking into your problem. I will look at it later today and post something that should help you. I have an MRI and then when I return, I will look at it

    ~Mike

  3. #3
    ch3f is offline Junior Member
    Join Date
    Mar 2010
    Posts
    2
    Mike,

    Thanks for taking to the time to respond to my post. I figured out my issue, I needed to update my wsdl.xml file. So, I will be chalking that one up.

  4. #4
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    557
    Blog Entries
    15
    Oh okay great sorry for not getting to this sooner

+ Reply to Thread

Similar Threads

  1. Upsert Record(s) related to other Objects
    By quantentunnel in forum Salesforce Coding Discussions
    Replies: 2
    Last Post: 02-22-2010, 03:02 PM
  2. Displaying Child Records in A Nested Query
    By alcom in forum Salesforce PHP Tutorials
    Replies: 12
    Last Post: 01-16-2010, 07:16 AM
  3. how to search on multiple objects
    By jlowtek in forum Salesforce PHP Tutorials
    Replies: 3
    Last Post: 08-04-2009, 08:01 AM
  4. Fields not retrieved
    By lstr in forum Salesforce PHP Tutorials
    Replies: 5
    Last Post: 05-15-2009, 01:40 PM
  5. Create Record on Custom Object using PHP
    By mike in forum Salesforce Coding Discussions
    Replies: 4
    Last Post: 11-06-2007, 03:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.1