Created
September 23, 2019 02:05
-
-
Save sfdcale/6fe61b55f7114581f3e002469f6ba338 to your computer and use it in GitHub Desktop.
This bash script is to list all the custom fields in the system as CustomField doesn't support wildcard
This file contains hidden or 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
| #!/bin/bash | |
| extensionsToExclude=( | |
| 'History' | |
| '__History' | |
| 'Share' | |
| '__Share' | |
| 'ChangeEvent' | |
| '__ChangeEvent' | |
| ) | |
| input="ObjNames.csv" | |
| rm CustomFields.txt | |
| touch CustomFields.txt | |
| while IFS= read -r objName | |
| do | |
| echo $objName | |
| excludeObject=false | |
| for objExt in "${extensionsToExclude[@]}" | |
| do | |
| if [[ $objName == *"$objExt" ]]; then | |
| echo "Skipping $objName" | |
| excludeObject=true | |
| break | |
| fi | |
| done | |
| if [[ $excludeObject == false ]]; then | |
| echo "proceeding with $objName" | |
| sfdx force:schema:sobject:describe --targetusername=prod --sobjecttype=$objName --json | jq -r --arg objName $objName '.result.fields[] | $objName + "." + .name' >> CustomFields.txt | |
| fi | |
| done < "$input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment