Code共享
如果用共享 对象的共享设置必须为私有
如果用共享 对象的共享设置必须为私有
list<ImplementProject__Share> ilist = new list<ImplementProject__Share>();
ImplementProject(自定义对象名)__Share 共享名字
ImplementProject__Share is = new ImplementProject__Share();
is.UserOrGroupId = p.ProjectTeamUser__c;//要共享给的user的Id
is.ParentId = p.ProjectImplement__c;//所共享的记录Id
is.AccessLevel = 'Edit';//只读Read,读/写Edit,所有人All
ilist.add(is);
if(ilist.size()>0)
{
insert ilist;
}