From 5e64cf4e4b1d448f75839f1e18268ca9c88edff4 Mon Sep 17 00:00:00 2001 From: Alan Morey Date: Mon, 25 Feb 2019 09:22:17 -0800 Subject: [PATCH] Query only for metadata type folders Limit query on Folders to find entries only where the folder type is mappable to a metadata folder type. Fixes #69 --- force-meta-backup.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/force-meta-backup.groovy b/force-meta-backup.groovy index d3c8800..df4bb70 100755 --- a/force-meta-backup.groovy +++ b/force-meta-backup.groovy @@ -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 = [:]