Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save okram999/3deaafce89f30fbb5ff9ff3a89fb8d9e to your computer and use it in GitHub Desktop.
Save okram999/3deaafce89f30fbb5ff9ff3a89fb8d9e to your computer and use it in GitHub Desktop.
Check if a fields is referenced anywhere in a sandbox

Check if a fields is referenced anywhere in a sandbox

Tools:

  • Ant
  • bash
  • DOS2Unix converter
  • IDE (e.g. VSCode/Atom)
  1. Create a directory structure as
  • build
  • src -- package.xml -- fields.txt -- findFieldRef.sh
  1. Retrieve the metadata for the required types (e.g. Reports, ReportsTypes, etc) --- ant -f build/build.xml getCode -Dsfdc.serverurl=https://login.salesforce.com/ -Dsfdc.username=###### -Dsfdc.password=##### (You might need to pull in parts, if it exceeds 10K api limit) NOTE: to comment a line/lines - press keys: Ctrl + /

  2. Update the fields list --- If on Windows OS, convert to unix format. CMD: dos2unix fields.txt

  3. Execute the script --- ./findFieldRef.sh

  4. The result of the scrit will be in Results.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment