• ecivs
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am trying up update a custom table with a lookup to another custom table using the php toolkit.

How do I do this? Everything I try gets either a SOAP error or an UPSERT error message:

 

Here is the code

NOTE: $mElite is data from our local MySQL server.

 

...

$mSFR = new stdclass();

$mSFR -> type = 'FCL_Hed__c';

...

$mSFR -> Orig_Num__r -> Number__c = $mElite -> orign;

..

$mURs = $mSforceConnection -> upsert( 'Multi_Key__c', $mSFRs, 'FCL_Hed__c' );

...

 

 

Yields these errors:

 

PHP Warning:  Creating default object from empty value in /d01/dev/ECI/salesforce/fclhedUpsert.php on line 293
PHP Stack trace:
PHP   1. {main}() /d01/dev/ECI/salesforce/fclhedUpsert.php:0

 

... error message from upsert response ...

FCL_Hed__c: bad field names on insert/update call: type

The table that Orig_Num__r refers to is Sched__c:

 

...

ORIGN#   Orig_Num__c   Lookup(Sched)

...

 

 

and Sched__c looks like this:

 

...

Number  Number__c  Text(5) (External ID)
CNTNUM  CNTNUM__c  Text(4) (External ID)

...

 

 

  • March 04, 2013
  • Like
  • 0

Hello everyone,

 

I'm learning how to use the PHP toolkit, and I nedd some help. I want to query the Account Name field, so I do this

 

<?php

require_once ('sforce-php/soapclient/SforcePartnerClient.php');

try {
  $mySforceConnection = new SforcePartnerClient();
  $mySoapClient = $mySforceConnection->createConnection("sforce-php/samples/partner.wsdl.xml");
  $mylogin = $mySforceConnection->login(LOGIN,PASSWORD+TOKEN);

  $userResult = $mylogin->userInfo;
  
  $query = 'SELECT Id,Name from Account limit 5';
  $response = $mySforceConnection->query(($query));
  $sObject = new stdClass();
  foreach ($response->records as $record) 
  {
       print_r($sObject->Name);   
       print_r("<br>");
  
  }
  
} catch (Exception $e) {
  echo $e->faultstring;
}
?>

 

But I get: Notice: Undefined property: stdClass::$Name

 

 

Any advice?

 

 

Thanks in advance

 

 

Best regards

 

JJUPO

  • February 08, 2013
  • Like
  • 0