• flkeysmarlin
  • NEWBIE
  • 0 Points
  • Member since 2006

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

In PHP5, An object with no properties is no longer considered "empty".

So how do I make something like the following work?

Code:

$purch_progname = $sObject->fields->Conversion_Program_Name__c;
echo "($purch_progname) <br>";
print_r($purch_progname);
if( !empty($purch_dataname) ) {
  ...do stuff that requires a value in $purch_progname...
}




 The results of the echo and print_r above are:

for the echo:

()

for the print_r:

SimpleXMLElement Object
(
)

Thanks.

Sean

Hello,
I am trying to "put" data from an Opportunity into another tab object called "Batches".
I have an example of how it was done by my organization in the past using a custom link but I am not sure if there is a better way.
Here is part of a custom link within Opportunity:
https://na1.salesforce.com/a00/e? retURL=%2F00630000001b2Sq &Name={!Opportunity_Batch_Number} &00N30000000i3EK={!Opportunity_Batch_Number} &00N30000000j5Dl={!Opportunity_Batch_Number} &CF00N30000000hK45={!Opportunity_Account_Name} &CF00N30000000gpxH={!Opportunity_Name}& ....
It looks like in order refer to fields of an object outside the current object, you have to specify their object id.
My question is what is the "a00/e" and how do you know to use it. And what is "=%2F00630000001b2Sq".
There appears to be a "CF" in front some object ids. Is this kind of usage documented anywhere?
If this is how to get and put data between objects, is there a way to get a complete report of ALL object names and IDs to make development easier? I find it hard to believe that this is the way it's done, but I'm new with SalesForce so anyhelp would be great.
Thanks.
 
 

In PHP5, An object with no properties is no longer considered "empty".

So how do I make something like the following work?

Code:

$purch_progname = $sObject->fields->Conversion_Program_Name__c;
echo "($purch_progname) <br>";
print_r($purch_progname);
if( !empty($purch_dataname) ) {
  ...do stuff that requires a value in $purch_progname...
}




 The results of the echo and print_r above are:

for the echo:

()

for the print_r:

SimpleXMLElement Object
(
)

Thanks.

Sean

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');
–>