-
Notifications
You must be signed in to change notification settings - Fork 0
/
flowVF.page
38 lines (35 loc) · 1.47 KB
/
flowVF.page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<apex:page sidebar="false" lightningStylesheets="true" >
<html>
<head>
<apex:includeLightning />
</head>
<body class="slds-scope">
<div id="flowContainer" />
<script>
var statusChange = function (event) {
if(event.getParam("status") === "FINISHED") {
// Control what happens when the interview finishes
var outputVariables = event.getParam("outputVariables");
var key;
for(key in outputVariables) {
if(outputVariables[key].name === "myOutput") {
// Do something with an output variable
}
}
}
};
$Lightning.use("c:flowAuraApp", function() { // Replace the Aura Application name here if yours havs a different name
// Create the flow component and set the onstatuschange attribute
$Lightning.createComponent("lightning:flow", {"onstatuschange":statusChange},
"flowContainer",
function (component) {
// Start an interview in the flowContainer div, and
// initializes the input variables.
component.startFlow("SFL_createContact"); // API NAME for the target flow
}
);
});
</script>
</body>
</html>
</apex:page>