We have an utility which imports all data from one org to another, this results in creating public groups every time import operation is carried out. Is there any way we can perform delete operation on Public groups before starting new import.


1 Answer 1


you can simply run SOQL query to select groups and perform delete in anonymous apex

delete [
    select Id
    from Group 
    where DeveloperName = 'test'
        and Type = 'Regular'

also you can use ant migrating tool to delete public groups

in order to delete metadata you need to run destructive changes

in short, you will need to name in destructiveChanges.xml file, that you want to delete public groups

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .