• phpandsfdc
  • NEWBIE
  • 73 Points
  • Member since 2009

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

I am new to SF and just started developing with the PHP Toolkit 13.1.  I am currently using the Enterprise WSDL because I only work with a single instance of SF.  I need to be able to update custom fields to null, but have found that this is broken for at least 8 months.   Is there any news or plan if this will be fixed? And, if I really need this feature do I need to switch to the Partner WSDL?  If I switch what are the advantages/disadvantages? 

 

Thanks

  • November 16, 2009
  • Like
  • 1

Hi all,

 

Are there any intructions available for setting up the PHP Toolkit under a Unix environment? I have checked out http://wiki.developerforce.com/index.php/PHP_Toolkit_Setup but this only covers a Windows environment. I have setup PHP and Apache HTTP and tested that these work but I can't get any of my Salesforce code to work. Where should I put the PHP Toolkit files?

 

Thanks for any help

 

James 

Hi All,

Could some one provide me a sample code explaining how to create leads using PHP and Salesforce SOAP API?
it will be a great help for me

Thanks,
Regards

nilan

  • February 28, 2008
  • Like
  • 0

Does anyone know how to write custom fields to SalesForce from custom PHP form. For example we are trying to get check boxes to have checks in the admin side when the enduser checks off on the form. (WHITEPAPERS or TRY IT)   Also, we are trying to capture other custom text input fields, none of which I are writing into salesforce.

 

We have tried several different things and nothing is working.


Thank you

Per the Winter 10 release, the describeGlobal result's "types" property is no longer supported in favour of a new "sobjects" property which returns an array of DescribeGloablSObjectResult. 

 

However, the result set is always 0 records.  Are we missing something, or is this a bug?

 

DescribeGlobalResult describe = Auth.getBinding().describeGlobal(); if (describe != null) { DescribeGlobalSObjectResult[] dgos = describe.sobjects;

//replaces String[] types = describeGlobalResult.types;

 

foreach (DescribeGlobalSObjectResult dgr in dgos) { System.Diagnostics.Debug.WriteLine("### TEST : " + dgr.ToString()); System.Diagnostics.Debug.WriteLine("### TEST : " + dgr.name.ToString()); } }

 

I am having problems querying email messages through PHP. Here is my code:

 

 

require_once("login.php");
$type = "EmailMessage";
$objectType = $mySforceConnection->describeSObject($type);
foreach($objectType->fields as $field){
$fields[] = $field->name;
}
$query = "select ".implode(",",$fields)." from $type";
print "$query<br />";

$result = $mySforceConnection->query($query);
print_r($result);

 

 As you can see I use "describeojbect" to get all the fields for the type EmailMessage.  Then I build a query with all of the fields.  When I get back the records though they only contain the "id" field. Here is my result:

 

select Id,ParentId,ActivityId,CreatedById,CreatedDate,LastModifiedDate,LastModifiedById,SystemModstamp,TextBody,HtmlBody,Headers,Subject,FromName,FromAddress,ToAddress,CcAddress,BccAddress,Incoming,HasAttachment,Status,MessageDate,IsDeleted from EmailMessage
stdClass Object
(
[done] => 1
[queryLocator] =>
[records] => Array
(
[0] => stdClass Object
(
[Id] => 02sA0000000Cnm1IAC
)

[1] => stdClass Object
(
[Id] => 02sA0000000CnnAIAS
)

[2] => stdClass Object
(
[Id] => 02sA0000000Cnp2IAC
)

[3] => stdClass Object
(
[Id] => 02sA0000000CnlrIAC
)

[4] => stdClass Object
(
[Id] => 02sA0000000CnmvIAC
)

[5] => stdClass Object
(
[Id] => 02sA0000000CnteIAC
)

[6] => stdClass Object
(
[Id] => 02sA0000000CnvuIAC
)

[7] => stdClass Object
(
[Id] => 02sA0000000CnlwIAC
)

[8] => stdClass Object
(
[Id] => 02sA0000000Co9IIAS
)

[9] => stdClass Object
(
[Id] => 02sA0000000Co9EIAS
)

)

[size] => 10
)

 

If I do this for other types such as "Contact" it doesn't have this issue, all the fields are returned.  Any ideas why no fields are returning?  If I take the id's returned and paste them into the browser with correct url, it shows me the email.

 

Thanks,

Ted

 

  • December 21, 2009
  • Like
  • 0

I am new to SF and just started developing with the PHP Toolkit 13.1.  I am currently using the Enterprise WSDL because I only work with a single instance of SF.  I need to be able to update custom fields to null, but have found that this is broken for at least 8 months.   Is there any news or plan if this will be fixed? And, if I really need this feature do I need to switch to the Partner WSDL?  If I switch what are the advantages/disadvantages? 

 

Thanks

  • November 16, 2009
  • Like
  • 1

 

My client would not only like to be able to backup his SalesForce environment, but also be able to restore from that backup.

 

So far as I know, while many options make it possible to replicate SalesForce data elsewhere, there are no easy options for restoring data, so I've been trying to figure out how to do this.

 

Among the obstacles,  it is my understanding that Autonumber fields can not be overridden.  So, to properly restore sObjects with Autonumber fields, it will be necessary to first convert Autonumber fields to Text, and then restore them to Autonumber after the data has been restored (inserted).

 

Would it be possible to do this through the SalesForce API using PHP to develop the restoration solution?

 

If so,  how?

 

 

-Brian. 

 

Hi I have a wtl form on my site and I'm using CURL to send the POST data to salesforce.

 

Everything's fine except the problem I got with the multiple select fields in the form.

 

All I receive when form submitted is a simple 'Array' in the multi select field In SF leads. If I remove the '[]' from my select field I just receive the last option selected , anyway that should stay there cos I guess it's needed for the other php rutines with the form data.

 

Any ideas why is this happening, and how can be fixed?

 

Thanx

Hi Mike,

using the PHP snippit forsending an email with the v13 of the phpToolkit is rendering me this error:

***** Send Emails ***** Function ("sendEmail") is not a valid method for this service

My PHP looks like this:

PHP Code:
<?php

error_reporting
(E_ALL & ~ E_NOTICE);

$SOAPCLIENT_DIR="soapclient/";

ini_set("soap.wsdl_cache_enabled""0");
require_once (
"$SOAPCLIENT_DIR/SforcePartnerClient.php");
require_once (
"$SOAPCLIENT_DIR/SforceHeaderOptions.php");

require_once (
'SalesforceUserSettings.php');

$partner_wsdl "partner.wsdl.xml";

try {
  
$mySforceConnection = new SforcePartnerClient();
  
$mySoapClient $mySforceConnection->createConnection('partner.wsdl.xml');
  
$mylogin $mySforceConnection->login($USERNAME$PASSWORD);

  
$singleEmail1 = new SingleEmailMessage();
  
$singleEmail1->toAddresses 'ron@byressecurity.com';
  
$singleEmail1->plainTextBody "Hello there";
  
$singleEmail1->subject "First Single Email";
  
$singleEmail1->saveAsActivity true;
  
$singleEmail1->emailPriority EMAIL_PRIORITY_LOW;

  
$singleEmail2 = new SingleEmailMessage();
  
$singleEmail2->toAddresses 'ron@byressecurity.com';
  
$singleEmail2->plainTextBody "Hello there";
  
$singleEmail2->subject "Second Single Email";
  
$singleEmail2->saveAsActivity true;
  
$singleEmail2->emailPriority EMAIL_PRIORITY_LOW;

  echo 
"***** Send Emails *****\n";
  
$emailResponse $mySforceConnection->sendSingleEmail(array ($singleEmail1$singleEmail2));

  
print_r($emailResponse);

} catch (
Exception $e) {
  echo 
$mySforceConnection->getLastRequest();
  echo 
$e->faultstring;
}

?>
....

Whike installing the WWW::Salesforce module from CPAN, I got an invalid login error from Salesforce.

 

I double checked the ID, password and security token are correct. These have been used with another application written in Ruby.

 

Any ideas why this module for Perl is failing?

 

Output from CPAN:

 

cpan[1]> install WWW::Salesforce
(lots of messages about getting and building)
Enter username: **********
Enter password: **********
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/WWW-Salesforce....ok 1/29INVALID_LOGIN: Invalid username or password or locked out. at t/WWW-Salesforce.t line 22
t/WWW-Salesforce....NOK 2/29                                                 
#   Failed test 'Login test'
#   at t/WWW-Salesforce.t line 23.
FAILED--Further testing stopped.
make: *** [test_dynamic] Error 9
  CAPOEIRAB/WWW-Salesforce-0.11.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports CAPOEIRAB/WWW-Salesforce-0.11.tar.gz
Failed during this command:
 CAPOEIRAB/WWW-Salesforce-0.11.tar.gz         : make_test NO

  • June 11, 2009
  • Like
  • 0

Hi all,

 

Are there any intructions available for setting up the PHP Toolkit under a Unix environment? I have checked out http://wiki.developerforce.com/index.php/PHP_Toolkit_Setup but this only covers a Windows environment. I have setup PHP and Apache HTTP and tested that these work but I can't get any of my Salesforce code to work. Where should I put the PHP Toolkit files?

 

Thanks for any help

 

James 

I just downloaded the 13.0 download from here http://wiki.developerforce.com/index.php/PHP_Toolkit and it's exactly the same as my old version. In class SforceBaseClient it still says protected $version = '11.0'; and I find no changes with a diff to the 11.0b download

 

Has anyone else come across this? Are there any other toolkit download sites?

 

Thank you

 

Laura Williams, Cambrian House

  • April 07, 2009
  • Like
  • 0

SalesForceAlchemy

 

sfPyax

 

www.pypi.info <--There's a lot of help for SalesForce developers using Python.

We have a lead form that largely has text input fields and I've been asked to add a multi-select list box to the mix.  My insert function is below.  Can I simply use a post call like below to add the multiple data items?

 

Thanks,

 

Chuck

 

 

 


    $contact = new sObject('Lead',
                           null,
                           array(
                               'salutation' => $_POST['salutation'],
                               'Title' => $_POST['title'],
                               'FirstName' => $_POST['first_name'],
                               'LastName' => $_POST['last_name'],
                                 'Company' => $_POST['company'],
                                 'email' => $_POST['email'],
                                'LeadSource' => $_POST['lead_source'],
                                'Street' => $_POST['street'],
                                'City' => $_POST['city'],
                                'State' => $_POST['state'],
                                'Phone' => $_POST['phone'],
                                'PostalCode' => $_POST['zip'],
                                'Country' => $_POST['country'],
                                'Star_P_Client__c' => $productuse,                               
                               'Industry' => $_POST['industry'],
                               'Database__c' => $_POST['00N30000000qVb2'],
                               'KeyProductRequirement__c' => $_POST['00N30000000qVbA'],
                               'description' => $_POST['description'],
                               'CorporateDesktopOSStandard__c' => $_POST['00N30000000qVb3'],
                               'ERPSystem__c' => $_POST['00N30000000qVbE'],
                               'CorporateDesktopHWStandard__c' => $_POST['00N30000000qVbJ'],
                            $researchreport
                           )                          
                          );
    $createResult = $sfdc->create($contact);