0

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.

Thanks

0

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">
    <types>
        <members>*</members>
        <name>Group</name>
    </types>
</Package>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.