You need to sign in to do that
Don't have an account?
mhitt
lightning component parsing error
Hi friends,
I am trying to build a lightning component that launches a flow to create a new Order record, and then redirects the user to that new Order when they click finish. Since I am new at writing components I copied the code from here, but when I save I am getting this parsing error
Here is my component
And the controller
Could I please have some help? :)
Thank you!
I am trying to build a lightning component that launches a flow to create a new Order record, and then redirects the user to that new Order when they click finish. Since I am new at writing components I copied the code from here, but when I save I am getting this parsing error
Failed to save LaunchOpenOrderController.js: ESLINT_ERROR: {c:LaunchOpenOrder - CONTROLLER} line:col [7:39] --> Parsing error: Unexpected token ( : Source
Here is my component
<aura:component implements="force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global"> <aura:handler name="init" value="{!this}" action="{!c.init}" /> <lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}"/> </aura:component>
And the controller
({ init : function (component) { // Find the component whose aura:id is "flowData" var flow = component.find("flowData"); // In that component, start your flow. Reference the flow's Unique Name. flow.startFlow("OpenOrderPOC"); handleStatusChange : function (component, event) { 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 === "redirect") { var urlEvent = $A.get("e.force:navigateToSObject"); urlEvent.setParams({ "recordId": outputVar.value, "isredirect": "true" }); urlEvent.fire(); } } } } } })
Could I please have some help? :)
Thank you!
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_flow_inputs_get.htm
All Answers
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_flow_inputs_get.htm