1

so I have a script on a page on my website that connects to my SF, queries for a certain value, and returns the value. It looks like it should work, but I'm not seeing anything. $user is set, and the password, security token, and username is valid and functional. It connects fine too - I omitted all that code because it is not relevant.

$query = "SELECT Account.Webpage_Link__c FROM Account WHERE Name = '".$name."'";
$response = $sf->query($query);
$queryResult = new QueryResult($response);
foreach ($queryResult->records as $record) {
    $WebpageLink = $record->Webpage_Link__c;
}
echo $WebpageLink;

The $name is exactly the same as an Account Name in Salesforce, so that's not an issue either. Any help?

Edit:

I think the issue is within the query itself. I'm outputting the entire $record object using print_r(). For some reason the ID and Name will output fine, but my custom field (using the exact field name from SF) doesn't play nice.

4
  • Could you pls try once just putting name where clause not variable ?
    – MIX DML
    Oct 9 '15 at 17:29
  • $User has a specific meaning as a global variable in Salesforce with respect to Users, not Accounts, so it's a very relevant question for @PrabhatKumar to ask you to clarify. In essence, what exactly is Salesforce going to receive on their end? How are you sending this? I don't know that you're providing adequate info for anyone to properly answer your question.
    – crmprogdev
    Oct 9 '15 at 17:46
  • They're receiving an Account Name. And $user is not the variable actually in my code, it's just what I put here. The query should match the account name that matches the variable, then pull the Webpage_Link__c
    – AKor
    Oct 9 '15 at 17:54
  • 1
    @crmprogdev...I think $user variable here stands for a string value. Akor must be assigning a string in $user variable. Not a global variable of salesforce.
    – MIX DML
    Oct 9 '15 at 18:05
0

Turns out my Enterprise WSDL was not updated since before I added the custom field. Updated it and all my queries work fine.

See here: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_steps_generate_wsdl.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.