function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
learn_cloudsflearn_cloudsf 

create a public group when an account is created

How to automatically create a public group when an account is created?
sandip bijlwansandip bijlwan
trigger createPublicGroup on Account(after insert){
list<Group> lstGroup = new list<Group>();
  for(Account acc : trigger.new){
       Group test = new Group();
       test.Name = acc.name;
       lstGroup.add(test);
  }
insert lstGroup;
}

hope this would help.