Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- Displaying custom fields in php page using php too...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Displaying custom fields in php page using php toolkit
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-04-2012 04:58 AM
I am using the following code to display records from the Event Table.
<?php
define("USERNAME", "xxxx");
define("PASSWORD", "yyyy");
define("SECURITY_TOKEN", "zzz");
require_once ('soapclient/SforceEnterpriseClient.php');
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/ enterprise.wsdl.xml");
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
$query = "SELECT Subject,Description,EndDateTime,StartDateTime,Owne rID,Public_Name__c,Web_Publish__c from Event WHERE Web_Publish__c = TRUE";
$response = $mySforceConnection->query($query);
?>
<table id="customers">
<tr>
<th>Subject</th>
<th>Description</th>
<th>End</th>
<th>Start</th>
<th>Owner</th>
<th>Location</th>
<th>Web Publish</th>
</tr>
<?php
foreach ($response->records as $record) {
echo "<tr>";
echo "<td>".$record->Subject."</td>";
echo "<td>".$record->Description."</td>";
echo "<td>".$record->EndDateTime."</td>";
echo "<td>".$record->StartDateTime."</td>";
echo "<td>".$record->OwnerID."</td>";
echo "<td>".$record->Public_Name__c."</td>";
echo "<td>".$record->Web_Publish__c."</td>";
echo "</tr>";
}
?>
The results are shown here. The event fields subject, description and start and end times display ( times need formatting sensibly !) but niether of the custom fields or the field ownerid appear. One of the custom fields (Web_Publish__c) is used to filter the results, so the query recognises the field - but for some reason this fails to display. Using the Office Toolkit, all of this data correctly appears in Excel or Access.
It seems to me the problem is a php display issue. I must be doing something silly.
Any help much appreciated ! Thanks.
Solved! Go to Solution.
Re: Displaying custom fields in php page using php toolkit
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-04-2012 11:47 AM
I've sorted the problem with the custom fields - I needed to generate an installation specific WSDL - not simply use the default which comes when you install the php toolkit.
But I still can't display the OwnerID field !
This is the field that displays a user name (e.g Peter Smith ) in the Event Form but stores the id (e.g 023b000000098DnAAI) - but I can't even get the ID to show.
Anyone else had this problem - and come up with an explanation/solution ?
Thanks
Re: Displaying custom fields in php page using php toolkit
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-05-2012 01:58 PM
Problem has now disappeared by re-typing the line of code displaying OwnerID. So this problem was a red-herring, sorry !
Peter

