You need to sign in to do that
Don't have an account?
Nevin O'Regan 3
Error When Adding A Custom Component To Community Page
Hi guys,
I've created a custom screen flow and I want to add it to a community page, launched from a custom button on the Homepage.
The flow guides users through creating a case. I am getting the following error when I add the component to the page: "Action failed: c:CustomCaseCommunityComponent$controller$init [flowData is not defined]"
This is my component.
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,forceCommunity:availableForAllPageTypes,force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global">
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<lightning:flow aura:id="flowData"/>
</aura:component>
({
init : function (component) {
var flow = component.find(flowData);
flow.startFlow(CaseFlow);
},
})
I've created a custom screen flow and I want to add it to a community page, launched from a custom button on the Homepage.
The flow guides users through creating a case. I am getting the following error when I add the component to the page: "Action failed: c:CustomCaseCommunityComponent$controller$init [flowData is not defined]"
This is my component.
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,forceCommunity:availableForAllPageTypes,force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global">
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<lightning:flow aura:id="flowData"/>
</aura:component>
({
init : function (component) {
var flow = component.find(flowData);
flow.startFlow(CaseFlow);
},
})
Just update your code as below:
var CaseFlow = component.find("flowData");
flow.startFlow(CaseFlow);
Thanks,
Sucharita
All Answers
Hi Nevin,
just add double quotes as for aura:id
var flow = component.find("flowData");
Thanks,
Sucharita
I've tried this but it's still the same. When I add the component to the homepage of my community it doesn't actually even appear on the community, i get an error message in the content section within the Page Structure.
Just update your code as below:
var CaseFlow = component.find("flowData");
flow.startFlow(CaseFlow);
Thanks,
Sucharita