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
Sandeep Rahul PVSandeep Rahul PV 

Aura component is not working in Partner community?

Hi Guys,

I have an aura component that displays a newly created record on the lead detail page and it is forking fine for salesforce inside org but not in the community portal. Please help me to resolve this.

Thank you.
sandeep.
Aura:
====
<aura:component implements="lightning:availableForFlowScreens,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    <aura:attribute name="Message" type="List" />
    <aura:attribute name="body" type="string" />
    <aura:attribute name="eventRecevied" type="boolean" />
    <lightning:empApi aura:id="empApi" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:if isTrue="{!v.eventRecevied}">
    {!v.body}
    </aura:if>
</aura:component>

Javascript:
========
({
    doInit : function(component, event, helper) {
        const empApi = component.find('empApi');
        const channel = '/event/SlickTextToastEvent__e';
        const replayId = -1;
        empApi.subscribe(channel, replayId, $A.getCallback(eventReceived => {
            // Process event (this is called each time we receive an event)
            console.log('Received event ', JSON.stringify(eventReceived));
            const body = component.get('v.Message');
            body.push(eventReceived.data.payload.Message__c);
            console.log('Received body ', eventReceived.data.payload.Message__c);
            console.log('Received body ', body);
            component.set('v.body',eventReceived.data.payload.Message__c);
            component.set('v.eventRecevied',true);
            helper.helperMethod(component, eventReceived.data.payload.Message__c);
        })) .then(subscription => {
            console.log('Subscription request sent to: ', subscription.channel);
        });   
     }
})

 
SwethaSwetha (Salesforce Developers) 
HI Sandeep,
Do you see any error when you say it is not working in the community portal? Thx