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
sailaja majji 5sailaja majji 5 

insufficient access rights on cross-reference id error when updating owner Name

Hi  All ,

Can somebody  please help me out with the below problem .

There is an integration system with salesforce which is trying to update owner name on opportunity and receving below error .
"insufficient access rights on cross-reference id” 

Here is how they are assigning the name 
OPPORTUNITY.Owner.Name = “Oles”

I verified profile permissions and new Owner (Olsen )permissions  and everything seems to be in place .

Here is how the field is exposed in enterprise wsdl
  <element name="Owner" nillable="true" minOccurs="0" type="ens:User"/>

Any help would be greatly appreciated .

Thanks,
Sailaja

 
Amit Chaudhary 8Amit Chaudhary 8
Hi Sailaja,

If you want to updat the Opportunity Owner Name then you need to pass owenrID.
Please try below code

List<User> lstUser =[select id,name from user where name like '%Oles%' limit 1];

if(lstUser.size() > 0)
{
 OPPORTUNITY.Ownerid = lstUser[0].id ;
}

Please let us know if this will help you.

Thanks
Amit Chaudhary
sailaja majji 5sailaja majji 5
Thanks Amit .
It worked .

Sailaja