• Synchro
  • NEWBIE
  • 5 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 30
    Replies
I've been rummaging around the dev site, but I've not found it yet...
Is there someone whose job it is to be embarrassed about this?

http://validator.w3.org/check?uri=http%3A//www.salesforce.com/

That many errors is quite a feat.
I've noticed that the links to the forum in subscription messages are broken - here's an example:

http://forums.eng.salesforce.com/sforce/board?board.id=PerlDevelopment

that just gives me a host not found - it never gets as far as trying to log in.

It's also most annoying that the message does not contain a link directly to the entry that it's about (i.e. even if the above link worked, it would still not be as useful as it could be), and there are no links at all to this forum area (http://www.sforce.com/community/), though there are to other places. To reply to a subscribed thread I have to manually go to the forum web page then manually browse or search for the topic.

Please can you fix some of these issues as it detracts enormously form the usability of the forum and raises an unnecessary barrier to helping people out.
On Saturday I reported two SOAP bugs in PHP, and I was pleasantly surprised to find them fixed on Sunday!

http://bugs.php.net/bug.php?id=34787
http://bugs.php.net/bug.php?id=34788

To save you the reading - if nil parameters are submitted, then you should now get xsi:nil="true" values, and for unset params, they should have correct namespaces set. The fix is available in the latest snaps from snaps.php.net. I've just tried it and I find that it no longer automatically includes unset parameters with a nil value, so the second fix may now be invisible.
I'm adding contacts and/or leads successfully via SOAP/PHP. I'm not quite clear on which I should choose - If I don't have any owner id, should I create it as a lead or a contact with no owner? I'm just not quite clear abut the distinction between a lead and an unowned contact and which I should use when.
I noticed some oddities - you cannot create a lead without a company name (even though it's not marked as mandatory in the WSDL), but a contact doesn't have a company field at all.
I need a sanity check... I'm trying to create a task from PHP 5.1 - I've got queries and general API calls working, I'm just unsure about the correct way of building a create request. I started with Zeev's outline, but it's giving some results I don't quite understand. Here's my creation function:

public function reportActivity($contactid, $perpid, $activitytype, $mailshotid = 0, $comment = '') {
switch($activitytype) {
case 'sentemail':
$task = array(
'WhoId' => $contactid,
'Description' => "Task done",
'OwnerId' => $perpid,
'ActivityDate' => gmdate('Y-m-d H:i:s')
);
$taskvar = new SoapVar((object)$task, SOAP_ENC_OBJECT, "Task", "http://soapinterop.org/xsd");
$res = $this->salesforce->create((object)array('sObjects' => $taskvar));
var_dump($this->salesforce->__getLastRequest());
break;
}
return false;
}

Here's an example SOAP request that it generates:





aBTPLIddpPQ.7YVyZ4rmuR22cABcdEZN6ApXDuU.yKne_GQEO0pRd9r5QzwU6cUp.A5oafVKfB6NKS_nTjNRhRhD2wYHcrlK4SNdGN37zi4=





00530000000go7eAAQ
Task done
00530000000go7eAAQ
2005-09-13 16:35:20





I have the feeling that my namespaces are not quite right, and the structure is not quite the same as the example SOAP create message in the docs - they seem to declare namespaces inline, rather than in the header section, though I don't know if that make any difference.

Comments?
  • September 13, 2005
  • Like
  • 0
Is there someone whose job it is to be embarrassed about this?

http://validator.w3.org/check?uri=http%3A//www.salesforce.com/

That many errors is quite a feat.
Tran,

Is it possible to store a .php script in the Documents object and have it communicate with other objects through the API?

Thanks.
We're trying to eliminate for the salesforce.com customer any additional steps, but I think we're in a position right now where we may be burdening the user.  Info...
 
Is it true that we need to supply a customization guide so that people can use our application with the Upsert method, i.e., do we need to tell them is how to go into setup for all three of their tables (leads, accounts, and contacts) and create an extra field and set the externalID type?  We're looking for a means where we can automate this, as this is a ten step process X 3 for the three tables, but the extra field is what we need for the Upsert. Is it possible to automate the creation of this field via the API or any other means?
 
Here's what we see as the 'customization guide' for the user
1. Click setup
2. Click customize
3. Click leads
4. Click fields
5. Click new
6. Select email
7. Click next
8. Name it emailid
9. Tabbing to the next field will autofill it
10. Check 'external id'
11. Click next
12. Click next
13. Click save
 
In addition, the user would have to do this process for the extra information or notes field so that all extra form responses are stored as well.  This just can't be true, and here's why I say this: the new "passing of leads" program for AppExchange partners drops any non-contact info into Leads as Additional Information, and we did not have to modify our account to accept this information.
 
As you can see its a complex process so I am hoping we can automate through the API.  Would you please help?

Message Edited by n10ct on 05-03-2006 04:49 AM

  • May 03, 2006
  • Like
  • 0
So, I am have a helluva time updating this pesky column; ActivityDate. I have read the discussions and have figured out that it's how the string is getting converted; however, I am having issues doing this with the old school PEAR::SOAP. I took someone's advice and changed the $Globals['SOAP_RAW_CONVERT'} = true. However, that worked for the date, but then would not properly convert my string values.
 
All I want to do is insert an ActivityDate for a new task. It seems liked I have tried everything, and have come very close, but it ultimately messes something else up.
 
Has anyone....(your grandmother, niece, dog, or postal carrier) been able to come up with a workable solution for this problem?
 
Thanks!
Melissa
 
I'm working in the php toolkit for the first time, but I am proficient in the ajax toolkit.

I have successfully upserted some records to sf.com, but I'm having problems getting some query results back. This code is erroring out on me:

   Code:
 $Account_query = "Select Id, Name from Account where Dot_Project_Number__c = '".$company_id."'";
 $Account_query_Result = $mySforceConnection->query($Account_query);

 foreach ($Account_query_Result as $ThisAccount) {
   $sObject = new SObject($ThisAccount); //error on this line
   $Account_Id = $sObject->Id;
 }
The error is:

PHP Notice:  Trying to get property of non-object in C:\...\SforcePartnerClient.php on line 47

Any thoughts on why this isn't working?

Thanks,
Steve


  • March 11, 2006
  • Like
  • 0
Hi, I have the following code to get the owner id from an account:

$query_str = "select 'OwnerId' from 'account' where Name = 'The Company Name'";

$result = $client->query($query_str,1)
while (list($k1, $record) = each($result->records)) {
printf(":: %s",$record);
}
this is the output result:

:: Account
::
:: 00530000000QJjmAAG

It works but all I want is the account ID itself not the other 2 strings. Can someone explain why this is happenening? (I'm just trying to get an account ID from an account Name)...Thanks.

Message Edited by sideburn on 02-23-2006 01:31 AM

I've noticed that the links to the forum in subscription messages are broken - here's an example:

http://forums.eng.salesforce.com/sforce/board?board.id=PerlDevelopment

that just gives me a host not found - it never gets as far as trying to log in.

It's also most annoying that the message does not contain a link directly to the entry that it's about (i.e. even if the above link worked, it would still not be as useful as it could be), and there are no links at all to this forum area (http://www.sforce.com/community/), though there are to other places. To reply to a subscribed thread I have to manually go to the forum web page then manually browse or search for the topic.

Please can you fix some of these issues as it detracts enormously form the usability of the forum and raises an unnecessary barrier to helping people out.
Hi,

I've written a small sforce Partner WSDL PHP library based on the NuSOAP SOAP Toolkit. It obviates the need for PHP 5 and PEAR. All you need is the salesforce.php and nusoap.php files, both of which are included in the attached zip file. Download the zip from sourceforge at:

http://osdn.dl.sourceforge.net/sourceforge/sforce/php.sforce.nusoap.20051012.zip

Most of the API methods have been implemented; feel free to recommend more. The goal of this library was to make the basic operations -- create, update, delete, query, search -- easy to do. A lot of the response objects are still native PHP types. However, I've made a point of declaring a sObject class and returning it wherever possible.

I've also included an example php file and the original nusoap.php file, so you can see what modifications I've made.

Please send comments and feedback to rchoi21_AT_hotmail.com.

Thanks!

Ryan Choi
rchoi21_AT_hotmail.com

(Sorry for the re-post. Wouldn't let me edit the URL to point to sourceforge.)
I'm adding contacts and/or leads successfully via SOAP/PHP. I'm not quite clear on which I should choose - If I don't have any owner id, should I create it as a lead or a contact with no owner? I'm just not quite clear abut the distinction between a lead and an unowned contact and which I should use when.
I noticed some oddities - you cannot create a lead without a company name (even though it's not marked as mandatory in the WSDL), but a contact doesn't have a company field at all.
Hello, I try to make a request with a filter on the field LastModifiedDate in PHP but I don't know the PHP function to use...

$request = "select Id from Opportunity where LastModifiedDate > ". ? ."";

I read that It had to use gmdate(DATE_ISO8601) but I don't understand how. I'm using php 4.2.3

Thanks !

Hi,

I am having problems creating elements, in this case is campaign members. I am using the files from the php sample kit which refer to the urn:partner.soap.sforce.com

I can query anything perfectly, but for create calls nothing happens. Please give me a hand. I have looked around the forum for hours and I can't figure it out.

I have the endpoint , campaign id and contact id coming from a form. variables are passed ok.

$client = new SalesforceClient($SESSION); // $SESSION passed as a $_POST from the previous form.
$client->_endpoint = $_POST['sf_endpoint']; // endpoint passed as a $_POST from the previous form.

 $FIELDS = array('type'=>'CampaignMember','CampaignId'=>'$camp_id','ContactId'=>'$contactid');
 $result = $client->create($FIELDS);

if (PEAR::isError($result)) {
    print "<p><span style=\"color:#FF0000\">".$result->getMessage()."<br /></span></p>";
}

this returns NO error, but nothing is created. Am I passing the correct requiered fields?

I am running PHP Version 4.3.10. If I need to post the soap response or xml response, can anybody show me how to do that please?

I appreciate your help!

alivepjc

P.S.: dreamforce 05 rocked!

*** UPDATE 4 Feb 2005: It appears that one field was not having the utf8_encode function applied to it. Stupid error; you may now all point and laugh.



Greetings all; I recently had to code up a mechanism to insert/select cases into Salesforce via the SOAP API. Built everything up fine and began testing; eventually, some of the test cases included accented characters (umlauts, etc. e.g., ö). In these test cases, the insert call failed with the error message "java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence."

Having encountered this problem before, I scoured my archives and reminded myself that the text should be passed through utf8_encode() before making the SOAP call. No problem then; I wrapped each text item with a utf8_encode() call.

However, the problem still persists even after using utf8_encode(); now, the accented characters are being passed as values that look like garbage (e.g., �?¼). The same error message is returned from the SOAP call; scoping the wire shows that the SOAP headers are set to UTF-8 encoding.

Pretty stumped at this point; any help would be appreciated. Server details follows:

* Fedora Core 2
* Apache 2.0.51-2.7
* PHP 4.3.8 (cgi)
* PEAR::SOAP 0.8RC3
* Latest Salesforce client from Sourceforge

Cheers.

Message Edited by sprak on 02-04-2005 10:04 AM

  • January 31, 2005
  • Like
  • 0