function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sean_at_33050sean_at_33050 

describeLayout - IVALID_TYPE sObject type cannot be null

Newbie - trying to use the describe layout method from code samples found in these forums. I get the following error:
 
IVALID_TYPE sObject type cannot be null
 
The "welcome user (email)" works fine. NOTHING else is printed after the above error message. The "getlastrequest() ..." prints nothing.
Can someone point me in the right direction or at least explain how to turn on debug or XML tracing?
(using apache w SSL  2.0.59, PHP 5.1.6, using current partner wsdl from developer edition)
 
Thanks.
 
Here is the code:
 
Code:
<—php
require_once ('../soapclient/SforcePartnerClient.php');
require_once ('../soapclient/SforceHeaderOptions.php');

$mySforceConnection;
$sforceSoapClient;
$myUserInfo;
$wsdl = 'partner.wsdl.xml';
include ('header.inc');
try{
   $mySforceConnection = new SforcePartnerClient();
   $sforceSoapClient = $mySforceConnection->createConnection($wsdl);
   $loginResult = $mySforceConnection->login("myusername", "mypasswd"); /* real usr/pw here */
   $myUserInfo = $mySforceConnection->getUserInfo();
  } catch (exception $e) {
    print ('one error: ' . $e->faultstring . '<br>');
    print_r($mySforceConnection->getLastRequest());
    print_r('<br>');
    print_r($mySforceConnection->getLastRequestHeaders());
    print_r('<br>');
    print_r($mySforceConnection->getLastResponse());
    exit ();
  }
   /*  THIS WORKS */
  echo 'Welcome, ' . $myUserInfo->userFullName . "( $myUserInfo->userEmail )" . '.<br>';
 try {
    /* THIS DOES NOT */
    $describe = $sforceSoapClient->describeLayout("Opportunity");
    for($i = 0; $i < sizeof($describe->layouts); $i++) {
       print($describe->layouts[$i]->heading . "<br>");
    }
  } catch (exception $e) {
    print ('error: ' . $e->faultstring . '<br>');
    print_r($mySforceConnection->getLastRequest());
    print_r('<br>');
    print_r($mySforceConnection->getLastRequestHeaders());
    print_r('<br>');
    print_r($mySforceConnection->getLastResponse());
    exit ();
  }
include ('footer.inc');
–>

 
Tran ManTran Man
Make the call on $mySforceConnection
describe = $mySforceConnection->describeLayout("Opportunity");
rather than $sforceSoapClient.

Message Edited by Tran Man on 09-06-2006 05:53 PM

flkeysmarlinflkeysmarlin

That was most likely the problem. I tried that and got other errors, but am no longer working that issue.

Thanks.