function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shunshun 

insufficient access rights on cross-reference id

Hi,

When doing an insert, if I receive the faultcode 1239 and faultstring:

insufficient access rights on cross-reference id

what does this mean?

Shun
DevAngelDevAngel

Hi shun,

I'll need a little more info to help you out.  What fields are you inserting and on what object?

shunshun
Hi Dave,

I get this error when trying to insert a lead.

The following is the SOAP msg I am sending (with some field values changed, assuming that particular values don't cause this error).





valid session id
2.0




lead























salutation
Mr.


firstName
Test


lastName
Test


company
Test company


title



phone
111 111 1111


mobilePhone



fax



email
test@test.com


street



city



state



postalCode



country



description
test


status
Open Not Contacted


leadSource
test


rating
Warm


shunshun
Dave,

Let me try that again, the xml didn't show up correctly.

<?xml version="1.0" encoding="UTF 8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema instance" xmlns:types="salesforce/encodedTypes" xmlns:tns="salesforce" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Header>
<tns:headerStruct id="id1">
<session_id xsi:type="xsd:string">valid session id</session_id>
<version xsi:type="xsd:string">2.0</version>
</tns:headerStruct>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:insert xmlns:q1="sfconnector:SalesforceConnector">
<type xsi:type="xsd:string">lead</type>
<record href="#id1" />
</q1:insert>
<soapenc:Array soapenc:arrayType="tns:mapEntry[18]" id="id1">
<Item href="#id2" />
<Item href="#id3" />
<Item href="#id4" />
<Item href="#id5" />
<Item href="#id6" />
<Item href="#id7" />
<Item href="#id8" />
<Item href="#id9" />
<Item href="#id10" />
<Item href="#id11" />
<Item href="#id12" />
<Item href="#id13" />
<Item href="#id14" />
<Item href="#id15" />
<Item href="#id16" />
<Item href="#id17" />
<Item href="#id18" />
<Item href="#id19" />
</soapenc:Array>
<tns:mapEntry xsi:type="tns:mapEntry" id="id2">
<key xsi:type="xsd:string">salutation</key>
<value xsi:type="xsd:string">Mr.</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id3">
<key xsi:type="xsd:string">firstName</key>
<value xsi:type="xsd:string">Test</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id4">
<key xsi:type="xsd:string">lastName</key>
<value xsi:type="xsd:string">Test</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id5">
<key xsi:type="xsd:string">company</key>
<value xsi:type="xsd:string">Test company</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id6">
<key xsi:type="xsd:string">title</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id7">
<key xsi:type="xsd:string">phone</key>
<value xsi:type="xsd:string">111 111 1111</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id8">
<key xsi:type="xsd:string">mobilePhone</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id9">
<key xsi:type="xsd:string">fax</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id10">
<key xsi:type="xsd:string">email</key>
<value xsi:type="xsd:string">test@test.com</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id11">
<key xsi:type="xsd:string">street</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id12">
<key xsi:type="xsd:string">city</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id13">
<key xsi:type="xsd:string">state</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id14">
<key xsi:type="xsd:string">postalCode</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id15">
<key xsi:type="xsd:string">country</key>
<value xsi:type="xsd:string" />
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id16">
<key xsi:type="xsd:string">description</key>
<value xsi:type="xsd:string">test</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id17">
<key xsi:type="xsd:string">status</key>
<value xsi:type="xsd:string">Open Not Contacted</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id18">
<key xsi:type="xsd:string">leadSource</key>
<value xsi:type="xsd:string">test</value>
</tns:mapEntry>
<tns:mapEntry xsi:type="tns:mapEntry" id="id19">
<key xsi:type="xsd:string">rating</key>
<value xsi:type="xsd:string">Warm</value>
</tns:mapEntry>
</soap:Body>
</soap:Envelope>
DevAngelDevAngel

Hi shun,

The message refers to a cross reference id, which is typically an accountId, ownerId, and so on.  I did not notice any reference field in the soap message, are you trying to set the ownerID or any other ID when you create the lead?  If you are trying to set the ownerID, that is likely the problem.  If you need to set the ownerID to an ID other than the one that belongs to the login you are using, you should create the lead without the id and then update the lead with the ID that you want to use for assignment.  Another problem might be that there is some "security" or sharing issue.  It sounds like the exception is an indication that the system is trying to set the ownerID and that user doesn't have sufficient rights to create or own a lead.

 

Are you using the developer edition?

shunshun
Dave,

Hmm. Actually I'm not setting the OwnerID or any other ID that could be a reference to something else.

I guess the problem is that I can't recreate this problem since I don't know how to create a user who could get this kind of "insufficient access rights on cross-reference id" error when trying to insert a lead. (I don't have access to this user's account anymore).

Do you know how I could create a user with a certain profile so that they receive this error on an insert?

Thanks in advance,
Shun
pickerpicker

Dave,

Any particular reason that one cannot set the OwnerId of an event to anything other than the logged in user?  Is there anyway that I can set it when it is created, rather than creating it and then updating it?

Kirill_YunussovKirill_Yunussov

I had this error in Production also, and turned out that I was using a Sandbox ID as a parentID of the object I was inserting.