• thechad
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 13
    Replies
Hello,

Unfortunately, I am using an old PEAR:SOAP install, and a salesforce soap client found on source forge about 2 years ago.  It works great still, and I have modified it use the new functionality in the new wsdl.

I am however, having one issue with a couple of the functions.  If we look at upsert specifically, I can update 1 record, but it wont let me update an array of records (it supposed to let me do 200).

Here is the code I am using that works for a single record

Code:
$upsert_tasks['type'] = 'Task';
$upsert_tasks['External_ID__c'] = $data['LEAD']['TASK'][$x]['TASK_ID'];        
$upsert_tasks['Subject'] = utf8_encode($data['LEAD']['TASK'][$x]['SUMMARY']);
$upsert_tasks['Description'] = utf8_encode($data['LEAD']['TASK'][$x]['DESCRIPTION']);
$upsert_tasks['ActivityDate'] = substr($data['LEAD']['TASK'][$x]['DUE'],0,10);
$upsert_tasks['Priority'] = ($data['LEAD']['TASK'][$x]['PRIORITY']>3 — 'High' : 'Normal');        
$upsert_tasks['Status'] = $data['LEAD']['TASK'][$x]['STATUS'];        
$upsert_tasks['WhoId'] = $master_overall_record->Id[0];
$upsert_tasks['OwnerId'] = $owner_info->records->Id[0];
$upsert_task_final = array("ExternalIdFieldName"=>'External_ID__c',"sObjects"=>$upsert_tasks);
$results_upsert_tasks = $client->upsert($upsert_task_final);

Here is the code that does not work :

Code:
for($x=0; $x<sizeof( $data['LEAD']['TASK']); $x++) {
 $upsert_tasks[$y]['type'] = 'Task';
 $upsert_tasks[$y]['External_ID__c'] = $data['LEAD']['TASK'][$x]['TASK_ID'];         
 $upsert_tasks[$y]['Subject'] = utf8_encode($data['LEAD']['TASK'][$x]['SUMMARY']);
 $upsert_tasks[$y]['Description'] = utf8_encode($data['LEAD']['TASK'][$x]['DESCRIPTION']);
 $upsert_tasks[$y]['ActivityDate'] = substr($data['LEAD']['TASK'][$x]['DUE'],0,10);
 $upsert_tasks[$y]['Priority'] = ($data['LEAD']['TASK'][$x]['PRIORITY']>3 — 'High' : 'Normal');         
 $upsert_tasks[$y]['Status'] = $data['LEAD']['TASK'][$x]['STATUS'];         
 $upsert_tasks[$y]['WhoId'] = $master_overall_record->Id[0];
 $upsert_tasks[$y++]['OwnerId'] = $owner_info->records->Id[0];
}
$upsert_task_final = array("ExternalIdFieldName"=>'External_ID__c',"sObjects"=>$upsert_tasks);
$results_upsert_tasks = $client->upsert($upsert_task_final);

 It errors and says that it cannot find the type of the sobject.. any ideas?

Thank you in advanced.


I am looking to connect to a remote service... Can APEX do FTP or make SOCKET/SOAP connections?

Additionally can it create temporary files like CSV of tab?

Thanks for your help.
I am trying to display the 18 character key for campaigns in the campaign layout using a formula field for easy access to the full key, but using "Id" in the formula field only returns the 15 character key.

Can someone help me here?

Thank you in advance.
A strange error is occuring.  When I try to update an Account type, I get the error: INVALID TYPE: type 'sObject'

I use the same code to update the Opportunity object, and it works fine.

The array I am passing looks like this:

Code:
$update_array[$y]['type'] = "Account";
$update_array[$y]['Id'] = $accounts[$i]->AccountId;
$update_array[$y]['Marketing_Touched_Status__c'] = "true";
I am using the PHP salesforceclient (w/ nusoap). 

Thanks for any help  / direction you can provide.
 

Message Edited by thechad on 05-21-2007 12:19 PM

I know this is probably not the platform to ping for help on s-controls, but I get such a great response from the board that I thought I'd give it a whirl.

I would like to add an s-control to the Lead page layout, that does the following:
  1. LOGIC: If a column in the lead record has anything but NULL value, display result, otherwise display nothing.
  2. RESULT: I would like it to display a link (example: "This individual exists as a contact, click here to merge"), passing in the same column from the lead record, (which happens to be a contact ID) and do 1 of 2 things.
    1. Link to the SF Interface for merging records (pasing the lead id and the contact id)
    2. Link to my website where I can write a simple application to merge the records and return them to salesforce.
Can this be done?  Can someone help me down the right path to figure this out?

Thank you.
Greetings.

I recently created a Custom Object.  I can access the object through the interface, but for some reason it is not showing up in the WSDL when I go to SETUP -> Integrate -> Apex API

Any ideas... what am I missing?

Thank you.
Greetings...

I am using the latest version (for php 4) of the salesforce php client (I think 5.4).  My autoassignment rule worked perfectly until I updated the url for the soap call from:

https://www.salesforce.com/services/Soap/u/4.0

TO:

https://www.salesforce.com/services/Soap/u/7.0

Now the assignment rule doesn't work... and everything else does.  Here is my function

function addAutoAssign($autoAssignId) {
        $header = new SOAP_Header(
                '{urn:enterprise.soap.sforce.com}SaveOptions',
                NULL,
                array('autoAssign' => 'true', 'assignmentRuleId'=>$autoAssignId),
                0);
               
        $this->addHeader($header);   
    }

Any ideas what I need to change to make this work again?
I would like to perform a query like

Select Id, Name, Amount From Opportunity WHERE Amount != Some_Custom_Field__c

Is this possible... from what I have read in the docs, I gather the answer is no, but really really really want to be wrong.

Thanks for your help.
I am looking to connect to a remote service... Can APEX do FTP or make SOCKET/SOAP connections?

Additionally can it create temporary files like CSV of tab?

Thanks for your help.
I am trying to display the 18 character key for campaigns in the campaign layout using a formula field for easy access to the full key, but using "Id" in the formula field only returns the 15 character key.

Can someone help me here?

Thank you in advance.
Greetings.

I recently created a Custom Object.  I can access the object through the interface, but for some reason it is not showing up in the WSDL when I go to SETUP -> Integrate -> Apex API

Any ideas... what am I missing?

Thank you.
I would like to perform a query like

Select Id, Name, Amount From Opportunity WHERE Amount != Some_Custom_Field__c

Is this possible... from what I have read in the docs, I gather the answer is no, but really really really want to be wrong.

Thanks for your help.
*** 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