Note:
Default access lavel
trigger trgsharingTest on Case (after insert, after update) {
if(trigger.isAfter==true && (trigger.isInsert==true||trigger.isUpdate==true) && trigger.new.size()>0 && trigger.new!=null)
{
List<CaseShare> lstShare=new List<CaseShare>();
for(Case obj:trigger.new )
{
CaseShare objShare=new CaseShare();
objShare.CaseAccessLevel='Edit';
objShare.CaseId=obj.id;
objShare.UserOrGroupId='005i00000038RVcAAM';
lstShare.add(objShare);
}
//Database.SaveResult[] jobShareInsertResult = Database.insert(lstShare,false);
insert lstShare;
}
}
Default access lavel
trigger trgsharingTest on Case (after insert, after update) {
if(trigger.isAfter==true && (trigger.isInsert==true||trigger.isUpdate==true) && trigger.new.size()>0 && trigger.new!=null)
{
List<CaseShare> lstShare=new List<CaseShare>();
for(Case obj:trigger.new )
{
CaseShare objShare=new CaseShare();
objShare.CaseAccessLevel='Edit';
objShare.CaseId=obj.id;
objShare.UserOrGroupId='005i00000038RVcAAM';
lstShare.add(objShare);
}
//Database.SaveResult[] jobShareInsertResult = Database.insert(lstShare,false);
insert lstShare;
}
}
No comments:
Post a Comment