• develo
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hello. I'm using the PHP SOAP toolkit with the partner api and I'm getting a strange response when running a query operation. I've been a long time user of the Enterprise WSDL and have not had any problems. Here is the simple query I'm running:

 

$result = $client->query("SELECT Id, Email, FirstName FROM Contact WHERE email in ('john.doe@example.com') ");

 And here is my result:

 

QueryResult Object
(
    [queryLocator] => 
    [done] => 1
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [type] => Contact
                    [Id] => Array
                        (
                            [0] => 003G00000166xcxIAA
                            [1] => 003G00000166xcxIAA
                        )

                    [any] => john.doe@example.comJohn
                )

        )

    [size] => 1
    [pointer] => 0
    [sf:QueryResult:private] => SforcePartnerClient Object
...

 Does anyone know what is causing this? According to the samples the returned object should look something like this:

 

Array
(
    [0] => SObject Object
        (
            [type] => Account
            [fields] => stdClass Object
                (
                    [AccountNumber] => 12324312
                    [Name] => XYZ Account
                    [Website] => www.somewebsite.co.uk
                )

            [Id] => 0018000000Ll0VmAAJ
        )

 Any thoughts would be appreciated.

 

Hello.

 

I have a trigger which, on Task insert/update, iterates over all Tasks for a given Contact, determines which are Phone calls, finds the most recent one, and sets the activity date of that Task on the Contact.  Easy.

 

Then the client enabled the functionality that allows them to relate multiple Contacts with a Task.  So i updated the Trigger to incorporate the TaskRelation object.  But i'm seeing some odd behavior. 

 

On the New Task screen, I associate two Contacts and save.  The first thing my trigger does is query the TaskRelation table for that Task - but the debug log only shows one result.  If i query the table manually (same query via eclipse or whatever), i see two results.  I'm guessing this is a result of my trigger running before the other TaskRelation record is created?  Has anyone else seen this?  As far as i know, my options are limited - i can make it a @future call or a batch process...Anything else?

 

Thanks

Chris