当前位置:网站首页>INSUFFICIENT_ACCESS_ON_ CROSS_REFERENCE_ENTITY APEX / SALESFORCE
INSUFFICIENT_ACCESS_ON_ CROSS_REFERENCE_ENTITY APEX / SALESFORCE
2022-07-15 15:24:00 【sf_wilson】
*If you are trying to share "Record X" with "User Y" and "User Y" already has access to "Record X" this error happens.
Even though i understood what this means and have dealt with it earlier, this time this error message sucked my brain for one week. Finally, i got it sorted out and i hope this post helps someone understand and solve as well.
When does this error happen?
What does this error mean?
Scenario 1: Creating a new record (Account/Contact/...) and setting the Owner. Applies to updating records as well.
Scenario 2: Creating or Updating an Opportunity (just for an example, might be any object). Setting the related Account of the Opportunity.
Scenario 3: The Sharing Object.
INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:[] is a common issue when you try to update or create data with insufficient access on a record.
Kindly check the user profile and check whether the user has access to insert/update that record. Even if the user has access, kindly check whether the user has access to update fields like record types, lookup field, master-detail field, etc.
Troubleshooting steps:1. Make sure whether the user have access to record ids of the lookup fields and/or master-detail fields in the record.
2. Check the user Profile(CRUD Permissions).
3. Profile need to have access for the record types.
4. Record's OwnerId automatically gets share record when the record is inserted. If the apex code try to create the same(Share record for the owner) explicitly. This error occurs.Sample Code for this error:
Id usrId = UserInfo.getUserId();
Account objAccount = new Account( Name = 'Testing', OwnerId = usrId );
insert objAccount;
AccountShare objAccountShare = new AccountShare();
objAccountShare.AccountAccessLevel = 'Edit';
objAccountShare.AccountId = objAccount.Id;
objAccountShare.RowCause = 'Manual';
objAccountShare.UserOrGroupId = usrId;
objAccountShare.OpportunityAccessLevel = 'Read';
insert objAccountShare;
5. Check whether the apex code is trying to create share records to the record which the current user doesn't have access to it.
6. Check whether there are any hard-coded ids are miss matching the environments.Note: Even though trigger runs in System Mode, Sharing Settings will be checked. Only CRUD and FLS will not be checked against the user.
边栏推荐
- Clear understanding of big end and small end
- 【科科过信管】信管论文写作要求-摘要
- CRC16校验 C语言实现
- Core examination site for information system project managers (XI) two key technologies and architectures of the Internet of things
- Mobile Robotics (I) fundamentals of Mathematics
- 信息系统项目管理师考前10天极限冲刺+答案(七)
- 小bai挑战学c语言第七天----枚举、结构体、共用体
- 华为云Stack南向开放框架,帮助生态伙伴高效入云
- Information system project managers must recite the core examination points (IV) the relationship between UML classes
- 实现两个元素并排显示 (含flex一些属性的讲解)
猜你喜欢

小bai挑战学c语言第七天----枚举、结构体、共用体

信息系统项目管理师核心考点(八)软件集成技术

Information system project manager core examination site (IX) organizational structure type

Information system project managers must memorize the core examination points (III) 14 graphic tools of UML

Puge - Code Honghu team -vscade code formatting and sorting

信息系统项目管理师考前10天极限冲刺+答案(十):综合知识总结

Niuke 2021 summer training 3-b-black and white

信息系统项目管理师核心考点(六)OSI协议的分层,导图+真题

牛客2021暑期训练4-J-Average

nifi ListSFTP等代理设置
随机推荐
Doxygen的安装与使用及注释语法
Three main reasons for cloud disruption
Dynamic programming | longest common subsequence
小白挑战学c语言第一天----运行环境的搭建
Redis02: install redis in Linux Environment
点灯
蚂蚁隐私计算创新TEE技术获学术认可
C # write a GUI tool and decompile it
NiFi ListSFTP精讲
Background management system of e-commerce platform -- > preliminary preparation of the project (demand analysis, system design, environment construction and configuration files)
Core examination points for information system project managers (VII) software architecture style
牛客2021暑期训练6-H-Hopping Rabbit
Information system project managers must memorize the core examination points (III) 14 graphic tools of UML
第九届蓝桥杯B组省赛。
[kekeguo information management] how to write the procurement management of information management papers
象棋一本通
E-commerce platform background management system --- > system detailed design (user login, commodity management module)
E-commerce platform background management system --- > system detailed design (user management module)
Redis03:Redis的5大常用数据类型
实现两个元素并排显示 (含flex一些属性的讲解)