You need to sign in to do that
Don't have an account?
sean_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'); –>
Message Edited by Tran Man on 09-06-2006 05:53 PM
That was most likely the problem. I tried that and got other errors, but am no longer working that issue.
Thanks.