function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gage StaruchGage Staruch 

Invoke a flow from a global action

Hi everyone, I need to be able to schedule a flow from a global action. This is what I have so far

On the controller:

({
init : function (component) {
var flow = component.find(“flowData”);
flow.startFlow(“Schedule_Appointment“);
},
})


And in the cmp:

<!– ,force:lightningQuickActionWithoutHeader –>
<aura:component implements=”flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId,force:lightningQuickActionWithoutHeader” access=”global” >

<aura:handler name=”init” value=”{!this}” action=”{!c.init}” />
<lightning:flow aura:id=”flowData” />
</aura:component>


But I keep getting this error

Failed to save ScheduleAppointmentController.js: ESLINT_ERROR: {c:ScheduleAppointment - CONTROLLER} line:col [4:27] --> Parsing error: Unexpected character '“' : Source


Any tips?

Raj VakatiRaj Vakati
Change your controller code as below .. you have this '“' in your code insted of double quotes 

Use this code
 
({
init : function (component) {
var flow = component.find("flowData");
flow.startFlow("Schedule_Appointment");
},
})

 
Gage StaruchGage Staruch
That seemed to have worked, but I am now getting this error when trying to save


Failed to save ScheduleAppointment.cmp: c:ScheduleAppointment:1,3: ParseError at [row,col]:[2,3] Message: The markup in the document preceding the root element must be well-formed.: Source
Raj VakatiRaj Vakati
Try this code
 
<aura:component implements="flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global" >

<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:flow aura:id="flowData" />
</aura:component>