0

I've managed to get account data, but now I'm trying to get a case object - any case object - with no luck and, apparently, no example code.

To get accounts, I'm using this code:

$accounts = $mySforceConnection->search('FIND {Valid Account Name} IN Name FIELDS RETURNING ACCOUNT(ID)');

However, similar code doesn't work:

$cases = $mySforceConnection->search('FIND {Valid Case ID} IN CaseId FIELDS RETURNING Case(Subject)');

The Force Explorer tool returns results no problem and shows me these fields, but my code, when run, returns

[message:protected] => MALFORMED_SEARCH: Invalid IN fields group: CaseId

This happens no matter what fields I use and I know that the fields I'm testing are valid. I've tried using the associated account, the subject, different forms of ID... nothing.

Any ideas?

3
  • Take a look at the WSDL you're using.
    – crmprogdev
    Aug 28, 2015 at 15:10
  • There is no field group called CaseId. Try usig $cases = $mySforceConnection->search('FIND {Valid Case ID} IN Id FIELDS RETURNING Case(Subject)'); Aug 28, 2015 at 17:36
  • @VigneshwaranG, I tried that, below is the sanitized output: FIND {5008**********} IN Id FIELDS RETURNING Case(Subject) SoapFault Object ( [message:protected] => MALFORMED_SEARCH: Invalid IN fields group: Id [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/html/Forcetk/soapclient/SforceBaseClient.php [line:protected] => 876 [trace:Exception:private] => Array ( [0] => Array ... etc
    – T.Gentle
    Sep 7, 2015 at 14:24

1 Answer 1

0

After bashing my head against the wall quite a bit, I found a query that returned a case. From that I'll be able to explore how the structure is built.

FIND {Valid} IN Name FIELDS RETURNING CASE(AccountID)

I did look at every page I could find with the letters 'WSDL', but found very little that made sense. As is, I'll work with what I do have and leave this here for future reference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .