• ringneng
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi guys, I'm working with the API (PHP toolkit!), and on my page I'd like a list of emails that some users receive from Salesforce users.

 

To do this, I intended to create a IsRead__c custom field on my EmailMessage object, and take it from there. I don't see anywhere where that object could be modified. Does anyone know where I need to look or a better way to achieve this? Thanks!

Hey guys, I've lurked the forums in search of an answer but haven't found anything that could help me, and my problem seems so stupid I just can't figure it out.

 

I'm working with the PHP toolkit. Works like a charm except I'm querying for my Case sObject records. I created a custom field named Customer_Portal_User__c, that is a lookup relationship type field to a User__c object.

 

One would figure this code would be enough...

 

Query and result validation function:

 

public function getCasesByAccount($logged_acct, $connection) {
$query = "SELECT AccountId, Id, Customer_Portal_User__c, CaseNumber, Origin, Reason, Type, Category_Identifier__c, Client_Reference__c, Description, Subject, Priority, Status, OwnerId FROM Case WHERE Status IN ('New', 'Updated by Customer') AND AccountId = '".$logged_acct."'"; try { $response = $connection->query($query); } catch (Exception $e) {} if (count($response->records) >= 1) { return $response; } else { return "No cases under this account."; } }

 

And this is how I call my function and go through the records.

 

$acctCases = $salesforceDML->getCasesByAccount($logged_acct, $connection);
foreach ($acctCases->records as $record) {
echo "<div class='row'>";
echo "<div class='span-3'><a href='view_case.php?id=".$record->Id."'>View</a></div>";
echo "<div class='span-9'>".'Lalala'.$record->Customer_Portal_User__c."</div> ";
echo "<div class='span-6'>".$record->Subject."</div> ";
echo "<div class='span-9'>".$record->Type."</div> ";
echo "</div>";
}

 

 

Which outputs All of the fields, EXCEPT Customer_Portal_User__c:

 

if I var_dump the $record variable from the foreach, I get the following...

 

object(stdClass)#16 (10) { ["Id"]=> string(18) "500e0000000UZmkAAG" ["AccountId"]=> string(18) "001e0000003FQsSAAW" ["CaseNumber"]=> string(8) "00026957" ["Description"]=> string(5) "fghgh" ["Origin"]=> string(5) "Phone" ["OwnerId"]=> string(18) "005a0000008678DAAQ" ["Priority"]=> string(23) "4 - Feature Enhancement" ["Status"]=> string(3) "New" ["Subject"]=> string(5) "hgfhg" ["Type"]=> string(10) "Activation" }

 

THE FIELD ISN'T EVEN THERE!!! ALLLLLLLLLLLLLLLLLLLLLLLLLLLLL the fields are returned except THAT one. CHRISTTT. This is RIDICULOUS.

 

I've even tried swapping the $query from my function for this, but the same results.

 

$query = "SELECT FirstName__c, LastName__c, Account__c, 
				(SELECT Id, Subject, Customer_Portal_User__c from Cases__r)
				FROM User__c";

 

I just don't know anymore. Any suggestions?