Reply
Visitor
MyLadyIrony
Posts: 1
0

Account ID

Hi all,

 

I'm trying to create a case by making a soap envelope in Java and send it over HttpURLConnection using UTF-8.  I can successfully login, but when I try to create a case the result I receive is:

 

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><createResponse><result><errors><fields>AccountId</fields><message>Account ID: id value of incorrect type: 003E000000LNpsbIAD</message><statusCode>FIELD_INTEGRITY_EXCEPTION</statusCode></errors><id xsi:nil="true"/><success>false</success></result></createResponse></soapenv:Body></soapenv:Envelope>

 

The Soap envelope that I'm sending is:

"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:partner.soap.sforce.com\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
" <soapenv:Header>\n" +
" <urn:PackageVersionHeader>\n"+
" </urn:PackageVersionHeader>\n"+
" <urn:MruHeader>\n"+
" <urn:updateMru>0</urn:updateMru>\n"+
" </urn:MruHeader>\n"+
" <urn:QueryOptions>\n"+
" <urn:batchSize>10</urn:batchSize>\n"+
" </urn:QueryOptions>\n"+
" <urn:SessionHeader>\n"+
" <urn:sessionId>"+soapCaller.getSessionId()+"</urn:sessionId>\n"+
" </urn:SessionHeader>\n"+
" </soapenv:Header>\n" +
" <soapenv:Body>\n" +
" <urn:create>\n"+
" <sObjects xsi:type=\"ns3:Case\" xmlns:ns3=\"urn:sobject.enterprise.soap.sforce.com\">\n"+
" <ns3:AccountId>003E000000LNpsb</ns3:AccountId>\n"+
" <ns3:Priority>Medium</ns3:Priority>\n"+
" <ns3:Status>New</ns3:Status>\n"+
" <ns3:Subject>Automatic_Ticket_from_Java</ns3:Subject>\n"+
" <ns3:Description>description</ns3:Description>\n"+
" <ns3:SuppliedEmail>genedemo@null.net</ns3:SuppliedEmail>\n"+
" </sObjects>\n"+
" </urn:create>\n"+
" </soapenv:Body>\n" +
"</soapenv:Envelope>"

 

I have done a lot of research, but I'm still not even sure what an AccountId is, so I must be looking in the wrong places.   So here are my questions:

 

  1. What is an AccountId (I've tried just about everything I can think of)?
  2. How do I get ahold of one?
  3. What is it supposed to denote in case creation?

Thanks in advance!

Moderator
SimonF
Posts: 8,016
0

Re: Account ID

003E000000LNpsb is a contactId, not an accountId, hence the error message.

 

you would get an accountId by querying or searching the account SObject. as far as cases goes, the accountId represents the account (aka company) that opened the case.

Cheers
Simon
docs | blog | twitter