From 34d6957789499652d3397da52f32fe864baf5144 Mon Sep 17 00:00:00 2001 From: Mark Davidson Date: Fri, 29 Sep 2023 10:41:54 -0400 Subject: [PATCH] Add capability for flow to set/override returnURL. --- .../aura/URLFlowLauncher/URLFlowLauncherController.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/URL Flow Launcher/aura/URLFlowLauncher/URLFlowLauncherController.js b/URL Flow Launcher/aura/URLFlowLauncher/URLFlowLauncherController.js index 817a75b..a99db45 100644 --- a/URL Flow Launcher/aura/URLFlowLauncher/URLFlowLauncherController.js +++ b/URL Flow Launcher/aura/URLFlowLauncher/URLFlowLauncherController.js @@ -8,8 +8,15 @@ }, handleStatusChange : function (cmp, event, helper) { - if (event.getParam('status') === "FINISHED") { + var outputVariables = event.getParam("outputVariables"); + var outputVar; + for(var i=0; i < outputVariables.length; i++) { + outputVar = outputVariables[i]; + if(outputVar.name === "returnURL" && outputVar.value != "" && outputVar.value != null) { + cmp.set("v.returnURL", outputVar.value); + } + } helper.navigateToReturnUrl(cmp); } }