• raskren
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies

Hi,

 

I'm just getting started with PHP and have somewhat of a noob question.

 

I have a webpage which connects to the database using the PHP toolkit.  I am also using an Enterprise WSDL.  I issue a query that gets a list of Industries from the DB - this is from a custom object.  The code then iterates through the resulting array and builds an HTML table.  My problem is that I don't know how to handle null values.  PHP gives me an error when one or more of the fields in my query has a null value: Notice: Undefined property: stdClass::$Description__c in C:\Inetpub\sandbox\lmch\web-to-lead.php on line 231.  This wasn't an issue when writing S-controls as the script would just skip over that value gracefully. How do I modify this PHP to handle null values inside an array?

 

 

<?php echo("<p>The ".$w2l_company." is currently working with the following industries:</p>"); $industries_query = "SELECT Id, Name, Description__c, Sample_Occupations__c, Sample_Occupations_Long__c from Industry__c WHERE Display_on_Website__c = true"; $industries_response = $mySforceConnection->query($industries_query); if(count($industries_response->records) > 0) { echo("<table id='industries'><tr><th>Interest</th><th>Name</th><th>Description</th><th>Sample Occupations</th></tr>"); for($i = 0; $i < count($industries_response->records); $i++) { echo("<tr><td><input type='checkbox' id='".$industries_response->records[$i]->Id."' /></td><td>".$industries_response->records[$i]->Name."</td><td>".$industries_response->records[$i]->Description__c."</td><td>".$industries_response->records[$i]->Sample_Occupations__c."</td></tr>"); } echo("</table>"); } ?>

 

 

 

Message Edited by raskren on 01-21-2009 11:39 AM
Is it possible to authenticate as a SFDC user via an external webpage and connection.js?
 
For example, I have an website hosted at http://www.test-site.com with a page called "login.html".  On this page I have a link to the connection.js library like so: <script type="text/javascript" src="https://na6.salesforce.com/soap/ajax/14/connection.js"></script> This doesn't work when I try to authenticate using the sforce.connection.login method.
 
I've also tried hosting connection.js on my web server as well as modifying the relative paths within the script itself.
 
Is what I'm trying to accomplish possible?
I have a gold level partner portal license in my production org.  The partner has access to numerous contacts and needs to be able to enable self-service access for some of those contacts.  Despite the fact that the partner portal contact page layout is mapped to the standard Salesforce contact page layout which does contain an "Enable Self-Service" button, the button is not visible in the PRM portal.

I think a potential workaround might be to create a workflow that creates a self-service user using the Salesforce API when certain conditions are met on both the Account and Contact records.  If a Parter portal user triggers these conditions will the workflow fire?
Is it possible to login to a different Salesforce organization (assuming the user/pass is known) via s-control and run queries against the remote data?
 
For example: I administer Salesforce instance A where my s-control runs.  I also want to get data from Salesforce instance B and C which contains data I need to report on.  Can the s-control running in instance A retrieve this data?
 
Thanks.
I'm building a custom email system utilizing a combination of merge fields and s-controls and have run into some difficulty.  My s-control initiates a SOQL query to retrieve information from records related to an custom object.  The query seems to work as expected.  However, I'm having trouble processing the result.
 
Here's a sample query result (line breaks added by me):
 
{
 done:'true',
 queryLocator:null,
 records:
  {type:'Contact', Id:'0037000000XQptdAAD', Email:'bruce@gmail.com', Phone:'(412) 325-1565',},
 size:'1',
}
 
As you can see, the SOQL is returning a contact ID, email address, and phone number.  To me this looks like JSON but I can't get any scripts to pull members from the array.
 
I'd like to be able to put the email address into the "To:" box of my email and the phone number into the body.  Should SOQL results be interpreted as JSON and if so, how to do I pull out specific members?
 
Many thanks.
I'm lead in customizing Salesforce.com for a business incubator entity.
 
I'm looking for some guidance as to the best way to package our customizations so they can be applied to other Salesforce instances.
 
Does anyone have any tutorials or articles outlining the best approach?  We're not interested in publishing on the AppExchange just yet, just a way to keep our customizations portable and modular.  Thanks.

Hi,

 

I'm just getting started with PHP and have somewhat of a noob question.

 

I have a webpage which connects to the database using the PHP toolkit.  I am also using an Enterprise WSDL.  I issue a query that gets a list of Industries from the DB - this is from a custom object.  The code then iterates through the resulting array and builds an HTML table.  My problem is that I don't know how to handle null values.  PHP gives me an error when one or more of the fields in my query has a null value: Notice: Undefined property: stdClass::$Description__c in C:\Inetpub\sandbox\lmch\web-to-lead.php on line 231.  This wasn't an issue when writing S-controls as the script would just skip over that value gracefully. How do I modify this PHP to handle null values inside an array?

 

 

<?php echo("<p>The ".$w2l_company." is currently working with the following industries:</p>"); $industries_query = "SELECT Id, Name, Description__c, Sample_Occupations__c, Sample_Occupations_Long__c from Industry__c WHERE Display_on_Website__c = true"; $industries_response = $mySforceConnection->query($industries_query); if(count($industries_response->records) > 0) { echo("<table id='industries'><tr><th>Interest</th><th>Name</th><th>Description</th><th>Sample Occupations</th></tr>"); for($i = 0; $i < count($industries_response->records); $i++) { echo("<tr><td><input type='checkbox' id='".$industries_response->records[$i]->Id."' /></td><td>".$industries_response->records[$i]->Name."</td><td>".$industries_response->records[$i]->Description__c."</td><td>".$industries_response->records[$i]->Sample_Occupations__c."</td></tr>"); } echo("</table>"); } ?>

 

 

 

Message Edited by raskren on 01-21-2009 11:39 AM
Is it possible to authenticate as a SFDC user via an external webpage and connection.js?
 
For example, I have an website hosted at http://www.test-site.com with a page called "login.html".  On this page I have a link to the connection.js library like so: <script type="text/javascript" src="https://na6.salesforce.com/soap/ajax/14/connection.js"></script> This doesn't work when I try to authenticate using the sforce.connection.login method.
 
I've also tried hosting connection.js on my web server as well as modifying the relative paths within the script itself.
 
Is what I'm trying to accomplish possible?
Is it possible to login to a different Salesforce organization (assuming the user/pass is known) via s-control and run queries against the remote data?
 
For example: I administer Salesforce instance A where my s-control runs.  I also want to get data from Salesforce instance B and C which contains data I need to report on.  Can the s-control running in instance A retrieve this data?
 
Thanks.
I'm building a custom email system utilizing a combination of merge fields and s-controls and have run into some difficulty.  My s-control initiates a SOQL query to retrieve information from records related to an custom object.  The query seems to work as expected.  However, I'm having trouble processing the result.
 
Here's a sample query result (line breaks added by me):
 
{
 done:'true',
 queryLocator:null,
 records:
  {type:'Contact', Id:'0037000000XQptdAAD', Email:'bruce@gmail.com', Phone:'(412) 325-1565',},
 size:'1',
}
 
As you can see, the SOQL is returning a contact ID, email address, and phone number.  To me this looks like JSON but I can't get any scripts to pull members from the array.
 
I'd like to be able to put the email address into the "To:" box of my email and the phone number into the body.  Should SOQL results be interpreted as JSON and if so, how to do I pull out specific members?
 
Many thanks.
I'm lead in customizing Salesforce.com for a business incubator entity.
 
I'm looking for some guidance as to the best way to package our customizations so they can be applied to other Salesforce instances.
 
Does anyone have any tutorials or articles outlining the best approach?  We're not interested in publishing on the AppExchange just yet, just a way to keep our customizations portable and modular.  Thanks.