• RichardS
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Does anyone have some code for setting the Lead Assignment Rule (or default rule)
when creating a lead using the PHP API talking to version 4.0 sforce?

Thanks.
  • September 10, 2004
  • Like
  • 0

Hi,

I'm using the PHP toolkit (php-client-53.zip) and currently trying some queries on my SF data. Now I expected to get an array as a result every time regardless of the actual count of records found. But obviously its quite different.

Two examples to illustrate my problem (the query results are being output by PHP's print_r()):

Query 1 result (exactly one match in my SF data):

stdClass Object
(
    [type] => Contact
    [Id] => 00320000001AWQIAA4
)

Query 2 (two matches in my SF data):

Array
(
    [0] => stdClass Object
        (
            [type] => Contact
            [Id] => 00320000001AMA6AAO
        )

    [1] => stdClass Object
        (
            [type] => Contact
            [Id] => 00320000001AMAOAA4
        )
 

As you can see, the query will deliver a simple "Object" if ONE match is found, but an array of "Objects" if TWO or more matches are found. Normally one would expect it to be an array (with only one "Object") in the case of one match as well.

So, how am I supposed to walk through the result in a for- or while-loop, that will work in each case?

Any help appreciated!

-Harry

  • August 13, 2004
  • Like
  • 0