• RICIT
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

Hello. I need to replicatethe functionality of:

 

<body onload="document.getElementById('form').submit()>

<form id="form" method="post" action="http://localhost/Salesforce/testphp.php">

...(inputs with field data from salesforce)...

</form>

</body>

 

in a Visualforce Page.

 

Thank you!

  • January 05, 2010
  • Like
  • 0

<html>
<body>
{!Opportunity.Id}
</body>
</html>

 

shows a blank page.

Please Help!

Message Edited by RICIT on 01-05-2010 09:46 AM
  • December 30, 2010
  • Like
  • 0

Hello. I am trying to access Salesforce throught the PHP API, and I am unable to retrieve any data from custom fields. I am using the enterprise wsdl, and a modified version of a code example I found online: [php code:]

function get_accounts($connection, $table, $id, $rows, $column)
{
  $query = "SELECT ";
  foreach($rows as $row)
  $query.=$row;
  $query.=" FROM ".$table." WHERE(".$column."='".$id."')";
  $queryOptions = new QueryOptions(10);
  $response = $connection->query($query, $queryOptions);
    // New code starts here
    if ($response->size == 1)
    {
        $accounts = $response->records;
    }
else if($response->size != 0)
{
  $accounts = $response->records;
           // Cycles through additional responses if the number of records
            // exceeds the batch size
        while (!$response->done)
        {
            set_time_limit(900);
            $response = $connection->queryMore($

response->queryLocator);
            $accounts = array_merge($accounts, $response->records);
 
        }
    }
 
  return $accounts;
} [end php code]
 
Then my syntax for extracting the data is: (since it should only get one record with the id) $accounts[0]->fieldname; or, if it is a custom field: $accounts->fieldname__c;.
Can someone please enlighten me?
  • December 30, 2010
  • Like
  • 0

Hello. I need to replicatethe functionality of:

 

<body onload="document.getElementById('form').submit()>

<form id="form" method="post" action="http://localhost/Salesforce/testphp.php">

...(inputs with field data from salesforce)...

</form>

</body>

 

in a Visualforce Page.

 

Thank you!

  • January 05, 2010
  • Like
  • 0

<html>
<body>
{!Opportunity.Id}
</body>
</html>

 

shows a blank page.

Please Help!

Message Edited by RICIT on 01-05-2010 09:46 AM
  • December 30, 2010
  • Like
  • 0

Hello. I am trying to access Salesforce throught the PHP API, and I am unable to retrieve any data from custom fields. I am using the enterprise wsdl, and a modified version of a code example I found online: [php code:]

function get_accounts($connection, $table, $id, $rows, $column)
{
  $query = "SELECT ";
  foreach($rows as $row)
  $query.=$row;
  $query.=" FROM ".$table." WHERE(".$column."='".$id."')";
  $queryOptions = new QueryOptions(10);
  $response = $connection->query($query, $queryOptions);
    // New code starts here
    if ($response->size == 1)
    {
        $accounts = $response->records;
    }
else if($response->size != 0)
{
  $accounts = $response->records;
           // Cycles through additional responses if the number of records
            // exceeds the batch size
        while (!$response->done)
        {
            set_time_limit(900);
            $response = $connection->queryMore($

response->queryLocator);
            $accounts = array_merge($accounts, $response->records);
 
        }
    }
 
  return $accounts;
} [end php code]
 
Then my syntax for extracting the data is: (since it should only get one record with the id) $accounts[0]->fieldname; or, if it is a custom field: $accounts->fieldname__c;.
Can someone please enlighten me?
  • December 30, 2010
  • Like
  • 0