• pcave_jacksonriver
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Is there a way to make account id required when creating an opportunity using the API? The interface makes it required but it's possible to create an opportunity via the API without an associated account.

 

Thanks.

Hello, I'm running the following SOQL query using the API. What I've noticed is that if it doesn't find any records, the total_amount field is not returned aliased, which breaks code that is expecting it. 

 

SELECT SUM(AMOUNT) total_amount, COUNT(AMOUNT) total_count FROM Opportunity WHERE StageName = 'Refunded' AND Transaction_Date_Time__c > 2012-02-06T00:00:00-05:00 AND Transaction_Date_Time__c < 2012-02-06T23:59:59-05:00 AND Parent_Donation__r.StageName = 'Refunded'

 

Below is the result. Is there a way to consistently have it return the alias even if no records meet the critiera?

 

stdClass Object
(
    [done] => 1
    [queryLocator] => 
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [Id] => 
                    [any] => Array
                        (
                            [0] => 
                            [total_count] => 0
                        )

                )

        )

    [size] => 1
)

Is there a way to exit out of a batch process early? I'm working on a batch process that will be calling an external webservice, but since you're only allowed 1 callout, the session may expire during processing and I won't be able to reconnect. So I'll want to exit at that point.

 

Is this possible?

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.

 

Is there a way to make account id required when creating an opportunity using the API? The interface makes it required but it's possible to create an opportunity via the API without an associated account.

 

Thanks.

Hello, I'm running the following SOQL query using the API. What I've noticed is that if it doesn't find any records, the total_amount field is not returned aliased, which breaks code that is expecting it. 

 

SELECT SUM(AMOUNT) total_amount, COUNT(AMOUNT) total_count FROM Opportunity WHERE StageName = 'Refunded' AND Transaction_Date_Time__c > 2012-02-06T00:00:00-05:00 AND Transaction_Date_Time__c < 2012-02-06T23:59:59-05:00 AND Parent_Donation__r.StageName = 'Refunded'

 

Below is the result. Is there a way to consistently have it return the alias even if no records meet the critiera?

 

stdClass Object
(
    [done] => 1
    [queryLocator] => 
    [records] => Array
        (
            [0] => stdClass Object
                (
                    [Id] => 
                    [any] => Array
                        (
                            [0] => 
                            [total_count] => 0
                        )

                )

        )

    [size] => 1
)