I am new to salesforce can anyone help me with the trigger. I have tried it but not able to fulfill the requirement. Please help me any suggestions are appreciated. Requirement: A company wants to do collaboration using chatter group for project. Whenever Enable Collaboration checkbox is checked a respective chatter group should be created. Note: Only one chatter group should exist for a Project. Trigger: trigger ChatterGroupCreation on Project__c (after insert,after update) { if(Trigger.isAfter && Trigger.isInsert){ ChatterGroupCreationHandler.isProjectInsert(Trigger.new); } if(Trigger.isAfter && Trigger.isUpdate){ ChatterGroupCreationHandler.isProjectUpdate(Trigger.new,Trigger.oldMap); } } Handler: public class ChatterGroupCreationHandler { public static void isProjectInsert(List<Project__c> listProject){ System.debug('listProject'+listProject); List<CollaborationGroup> chatter=new List<CollaborationGroup>(); for(Project__c proj:listProject){ if(proj.Enable_Collaboration__c==true){ CollaborationGroup myGroup = new CollaborationGroup(); myGroup.Name=proj.Name; myGroup.CollaborationType='Public'; chatter.add(myGroup); } } System.debug('chatter'+chatter); insert chatter; } public static void isProjectUpdate(List<Project__c> listProject,Map<Id,Project__c>oldMapProject){ List<CollaborationGroup> chatter=new List<CollaborationGroup>(); for(Project__c proj:listProject){ Project__c oldProj=oldMapProject.get(proj.Id); if(oldProj.Enable_Collaboration__c==false && proj.Enable_Collaboration__c==true){ proj.addError('Already created'); CollaborationGroup myGroup = new CollaborationGroup(); myGroup.Name=proj.Name; myGroup.CollaborationType='Public'; //can be 'Public' or 'Private' chatter.add(myGroup); } } system.debug('chatter update'+chatter); insert chatter; } } The problem is if I have created 2-3 projects of same name then I cannot create a different chatter group for each. And also whenever I turn the checkbox from false to true in update it should check if there is chatter group created or not. Please help me.