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
nbknbk 

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

Hello All,

 

I am getting an issue while updating user object from Gold Partner User profile. This issue will come after winter 14 salesforce upgrade. Previously it is working fine. Please let me know if you have workaround for this issue. Tried with without sharing in the class level and other ways to overcome the issue but could't find the fix.

 

Sample Code:

@future  
    public static void disableUser(Set<ID> userIds)
        {     
       
  List<User> lstusers = [Select id from User where id in: userIds];
           
            for(User u : lstusers)
                {
                   u.isActive = false;
                
   }
            update lstusers;//throwing error

 

From Debug log:

04:31:04.056 (56044017)|EXCEPTION_THROWN|[708]|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:31:04.056 (56953655)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

Iqrar AhmedIqrar Ahmed
Hi nbk,
It seem like you have no access to users make sure by checking your profile.

Best Regards
IQRAR AHMED