@TestVisible
private void feedItemChangeAccessLevel4Communities(ClsWrappers.TriggerContext trgCtx){
if (trgCtx.isAfter){
if(!System.label.SYS_RunCaseTrigger.equalsIgnoreCase('NO')){
Map<Id,Case> caseMap = new Map<Id,Case>();
for(sobject so : trgCtx.newList){
Case c = (Case)so;
caseMap.put(c.Id, c);
}
List <feedItem> feed4CaseMap = new List<feedItem>();
Set <ID> caseIDSet = caseMap.keySet();
feed4CaseMap =[Select id, visibility, ParentId, Type from feedItem where ParentId IN: caseIDSet limit 50000];
System.debug('Test'+feed4CaseMap);
for(FeedItem item : feed4CaseMap){
String parent = item.ParentId;
if(item.Type == System.Label.FeedItem_Type && item.visibility ==System.Label.FeedItem_Visibility){
item.visibility = System.Label.FeedItem_Visibility_Internal_Users;
}
System.debug('Test'+item);
}
database.update(feed4CaseMap, false);
}
}
}
private void feedItemChangeAccessLevel4Communities(ClsWrappers.TriggerContext trgCtx){
if (trgCtx.isAfter){
if(!System.label.SYS_RunCaseTrigger.equalsIgnoreCase('NO')){
Map<Id,Case> caseMap = new Map<Id,Case>();
for(sobject so : trgCtx.newList){
Case c = (Case)so;
caseMap.put(c.Id, c);
}
List <feedItem> feed4CaseMap = new List<feedItem>();
Set <ID> caseIDSet = caseMap.keySet();
feed4CaseMap =[Select id, visibility, ParentId, Type from feedItem where ParentId IN: caseIDSet limit 50000];
System.debug('Test'+feed4CaseMap);
for(FeedItem item : feed4CaseMap){
String parent = item.ParentId;
if(item.Type == System.Label.FeedItem_Type && item.visibility ==System.Label.FeedItem_Visibility){
item.visibility = System.Label.FeedItem_Visibility_Internal_Users;
}
System.debug('Test'+item);
}
database.update(feed4CaseMap, false);
}
}
}
No comments:
Post a Comment