• David Baumann 31
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
I use the follwing query to find the median account revenue
List<AggregateResult> totalOppsClosedWon365 = [select AccountId, sum(Amount__c) Revenue, Account.Stage__c
 from Opportunity
where CloseDate = LAST_N_DAYS:365 and StageName = 'Closed Won' 
group by AccountId, Account.Stage__c
order by sum(Amount__c) asc];
but how do I access the Revenue value at the specific index which marks the center of the list? For example the Revenue at index 100 because this is the center of the list. 

I apprechiate any help! 
 
We are planning to deepen out integration between Salesforce and a third-party tool. Within the tool we have multiple accounts related to one contact. To replicate the relations between these contacts and accounts, I activated the AccountContactRelation Object in Salesforce. Now I can successfully create a relation based on a SOAP create() call which uses the external IDs to relate the records, but I can not delete such a relation in response to a change in the external system. (I use SoapUI for testing)

I tried to use this SOAP delete() request:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>${#TestCase#sessionId}</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:delete>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:AccountContactRelation" xmlns:xsi="http://www.w3.org/2001/XMLSchema instance">
            <!--Zero or more repetitions:-->
            <Account>
                <Account_ExternalID__c>2648</Account_ExternalID__c>
            </Account>
            <Contact>
                <Contact_ExternalID__c>4585</Contact_ExternalID__c>
            </Contact>
         </urn:sObjects>
      </urn:delete>
   </soapenv:Body>
</soapenv:Envelope>
I get the following error message: 
Unexpected element {}Account during simple type deserialization
What am I doing wrong?
 
I enabled AccountContactRelation in setup and also updated the WSDL file. After the import to SOAP UI I I tried to upsert a relationship between existing salesforce contact and acccount records with the following SOAP Request:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>XXXXXXXXXXXXXXXXXXXXX</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:upsert>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:AccountContactRelation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <AccountId>0011X000004XwSDQA0</AccountId>
         <ContactId>0031X0000034g8PQAQ</ContactId>
         <!--Zero or more repetitions:-->
         </urn:sObjects>
      </urn:upsert>
   </soapenv:Body>
</soapenv:Envelope>

Unfortunately, the response says: "Unexpected element {}AccountId during simple type deserialization" 
What am I doing wrong?

Regards,
David
Hi, 

First things first, I am more of an admin than a developer so please be gracious to me. 

We plan to deepen the integration between salesforce and our self-developed software in the future. At the moment we are using the Force.com Toolkit for PHP as offered on github (https://github.com/developerforce/Force.com-Toolkit-for-PHP). To me, the package seems to be quite old and I'am wondering whether we have the ability to use the latest SOAP API version (v44.0) with the toolkit. I tried to figure out which API version is used by the toolkit but my search was not really successfull. It would be great to get some insights from you!

I completed the SOAP Trailhead module and know that one can send a login() request to the current API via "https://test.salesforce.com/services/Soap/c/44.0" but how is this handled with the toolkit?

Regards,
David