Created
October 3, 2024 23:07
-
-
Save jkentjnr/cfa8fedccdd177e9a003ddedff4342d6 to your computer and use it in GitHub Desktop.
Salesforce_Bash_Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://salesforce.stackexchange.com/questions/275679/remove-all-old-flow-versions-using-sfdx | |
sfdx force:data:soql:query --query "SELECT Id FROM Flow WHERE Status = 'Obsolete'" --target-org $1 --use-tooling-api --result-format csv > flowTodelete.csv | |
while read c; do | |
if [[ "$c" != "Id" && "$c" != "Your query returned no results." ]] | |
then | |
sfdx force:data:record:delete --sobject Flow --record-id $c --target-org $1 --use-tooling-api | |
fi | |
done < flowTodelete.csv | |
rm flowTodelete.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment