Skip to content

Commit

Permalink
Query only for metadata type folders
Browse files Browse the repository at this point in the history
Limit query on Folders to find entries only where the folder type is
mappable to a metadata folder type.

Fixes #69
  • Loading branch information
alan-morey committed Feb 25, 2019
1 parent ced2c64 commit 5e64cf4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion force-meta-backup.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ class Folders extends ManifestBuilder {
}

private fetchAllFolders() {
def soql = "SELECT NamespacePrefix, DeveloperName, Type FROM Folder WHERE DeveloperName != '' ORDER BY Type, NamespacePrefix, DeveloperName"
def folderTypes = folderMetaTypeByFolderType.keySet()

def soql = "SELECT NamespacePrefix, DeveloperName, Type FROM Folder WHERE DeveloperName != '' AND Type IN ('${folderTypes.join("', '")}') ORDER BY Type, NamespacePrefix, DeveloperName"
def sObjects = forceService.query soql

def folders = [:]
Expand Down

0 comments on commit 5e64cf4

Please sign in to comment.