• 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 using the PHP Toolkit to create an application.

 

I've stumbled upon this issue several times, it's fixed itself magically the previous times, but it's starting to become a hassle and I'd like to have a logical explanation as to why it happens.

 

Say I have a custom object named User__c. If I add custom fields to this object, I'll need to update my metadata and my enterprise WSDL for the queries to fetch the info on the new fields.

 

When I do this, the first 24 hours the query will not return the field. After that it magically reads it. I've waited past this period... and still my code turns no results.

 

If I run the query using the Force Explorer tool, I can see the data just fine.

 

Maybe I'm forgetting config steps in Salesforce? It's driving me insane.

 

Here is my code.

 

$query = "SELECT Id, FirstName__c, LastName__c, Email__c, User_Role__c, Account__c, Location__c, Address_Line_1__c, Address_Line_2__c, City__c, Country__c, State__c, Postal_Code__c, Telephone_Number__c From User__c where Id = 'a2Le00000000Bk4EAE'";
$response = $connection->query($query);

 

I should see all the fields, but when I do a var_dump of the $response->records object, I get everything, except Address_Line_1__c, Line_2__c, City, State, and all the fields I added a few days ago.

 

{ 
["Id"]=> string(18) "a2Le00000000Bk4EAE" 
["Account__c"]=> string(18) "001e0000003LBG4AAO" 
["Email__c"]=> string(21) "stef.TASTAN@GMAIL.COM" 
["FirstName__c"]=> string(9) "ESTEFANIA" 
["LastName__c"]=> string(4) "COOL" 
["Location__c"]=> string(18) "a0Se0000000A5bCEAS" 
["User_Role__c"]=> string(12) "Account-wide" 
}

 

Hope someone can help. I'm going insane here :c

 

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? 

 

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?