• jaba raj
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi,
i am trying to retrive all contact record for particular account using Custom List Controller but it showing
error:
Error: customlistcontrollerforaccountandcontact Compile Error: Incompatible types since an instance of LIST<SObject> is never an instance of LIST<Contact> at line 18 column 8

Vf page:
<apex:page controller="customlistcontrollerforaccountandcontact" >
 <apex:pageBlock >
     <apex:pageblockTable value="{!record}" var="a">
     <apex:column value="{!a.name}"/>
<apex:column value="{!a.phone}"/>
     
     
     </apex:pageblockTable>
 
 
 </apex:pageBlock>
</apex:page>

controller:
public class customlistcontrollerforaccountandcontact
{

Id id=apexpages.currentpage().getparameters().get('id');
public ApexPages.StandardSetController setCon {
get {
if(setCon == null) {
setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
[select name,phone from contact where accountid=:id]));
}
return setCon;
}
set;
}
// Initialize setCon and return a list of records
public List<Contact> getrecord() {
return (List<Contact>) setCon.getRecords();
}
}


any help


Thanks in advance

 

HI ,

      i am new to salesforce intergration i have retrive data from from account and contact object but i do know how to insert value to account object or custom object using php insert operation........

I am a php programmer with a decade of experience building websites in php. I built a php website, running on a Linux server, for a client who has recently created a SF account, and wants me to integrate my website with SF. So for example, when someone signs up on the website I built, they would be added as a contact in her SF account. But I'm having huge difficulties understanding the SF developers documentation. I am seeking some "Hello World" examples so that I can get some small scripts working, and from there, hopefully I could be on my way. I'd be eternally grateful for assistance on this.

Hello!

I have a problem with salesforce api for PHP. I can't connect.

I use XAMPP on windows 7 and free salesforce developer account..

 

 

The url:

https://127.0.0.1/sforce-php/prueba.php

 

The code:

<?php
define("USERNAME", "MyMailXXX@gmail.com");
define("PASSWORD", "My password XXX");
define("SECURITY_TOKEN", "The TOKEN XXX");
 
require_once ('soapclient/SforceEnterpriseClient.php');
 
$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");

$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

$query = "SELECT Id, FirstName, LastName, Phone from Contact";
$response = $mySforceConnection->query($query);
 
echo "Results of query '$query'<br/><br/>\n";
foreach ($response->records as $record) {
    echo $record->Id . ": " . $record->FirstName . " ".
        $record->LastName . " " . $record->Phone . "<br/>\n";
}
?>

 

The error message:

 

Warning: SoapClient::__doRequest() [soapclient.--dorequest]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in C:\xampp\htdocs\sforce-php\soapclient\SforceBaseClient.php on line 159

Fatal error: Uncaught SoapFault exception: [HTTP] SSL support is not available in this build in C:\xampp\htdocs\sforce-php\soapclient\SforceBaseClient.php:159 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://login.s...', '', 1, 0) #1 C:\xampp\htdocs\sforce-php\soapclient\SforceBaseClient.php(159): SoapClient->__call('login', Array) #2 C:\xampp\htdocs\sforce-php\soapclient\SforceBaseClient.php(159): SoapClient->login(Array) #3 C:\xampp\htdocs\sforce-php\prueba.php(19): SforceBaseClient->login('MymailXXX@gmail.com', 'Password+TokenXXX') #4 {main} thrown in C:\xampp\htdocs\sforce-php\soapclient\SforceBaseClient.php on line 159

 And phpinfo()

 

 

 

 

I have no idea of the error...

 

Thanks,

Jesusnoseq.