You need to sign in to do that
Don't have an account?
Prajarikam
I need to diasble users to create , share, poll files in chatter object.
Hi everyone how can i do it . I think we need to use homepage layout, but how to do it . Can anyone help me on that.
Regards,
Praveen.
Hi Praveen,
You can write a Trigger on FeedItem object to control the access of users.A sample code is below :-
Trigger controlpost on FeedItem (before insert,before update){
String check = null;
List<User> uids = [SELECT id FROM User];
List<CollaborationGroup> gids = [SELECT id,CollaborationType FROM CollaborationGroup];
for(FeedItem fid: trigger.new){
for(User uid: uids){
if(uid.id == fid.ParentId){
check = 'cp';
}
}
}
for(FeedItem fid: trigger.new){
for(CollaborationGroup gid: gids){
if(gid.id == fid.ParentId && gid.CollaborationType == 'Public'){
check = 'cpg';
}
}
}
for(FeedItem fid: trigger.new){
if((check == 'cp') ){
if((fid.Type == 'TextPost')&&(sharecommentscp == False)){
fid.addError('Sorry, Posting Comments to Profiles are not allowed due to security reasons!');
}
else if((check == 'cpg') ){
System.debug(fid.type + ' this is type ' + sharelinkscpg + ' this is custom setting');
if((fid.Type == 'TextPost')&&(sharecommentscpg == False)){
fid.addError('Sorry, Posting Comments to Public Groups are not allowed due to security reasons!');
}
}
}
}