Skip to content

Commit 7e65628

Browse files
authored
Updated flow deploy method to return the same count as the inputs (#12)
* Fixes #11 - previously, the deploy() method used by Flow was returning a list that only contained 1 value (the deployment job ID). This results in the error "The number of results does not match the number of interviews that were executed in a single bulk execution request" - the returned list now has the same number of outputs as the provided list of inputs.
1 parent de7fdc9 commit 7e65628

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

force-app/main/custom-metadata-saver/classes/CustomMetadataSaver.cls

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ public inherited sharing class CustomMetadataSaver {
7676
Metadata.DeployCallback callback = getFlowDeployCallback(customCallbackName, sendEmailOnError, sendEmailOnSuccess);
7777
System.debug('callback==' + callback);
7878

79-
return new List<String>{ deploy(consolidatedCustomMetadataRecords, callback) };
79+
// TODO need to add an actual Flow to the repo (./extra-tests/ directory probably) to verify Flow functionality works
80+
String jobId = deploy(consolidatedCustomMetadataRecords, callback);
81+
List<String> flowJobIds = new List<String>();
82+
for (Integer i = 0; i < inputs.size(); i++) {
83+
flowJobIds.add(jobId);
84+
}
85+
return flowJobIds;
8086
}
8187

8288
public static String deploy(List<SObject> customMetadataRecords) {

0 commit comments

Comments
 (0)