Skip to main content
AURA Controller.js

doInit: function(component, event, helper) {

        var userId = $A.get("$SObjectType.CurrentUser.Id");

        //alert(userId);

        console.log('userId'+userId)

        debugger;

            var action = component.get("c.getRecordTypeId");

            action.setParams({userId:JSON.stringify(userId)});

            action.setCallback(this, function(response){

                var rtnValue = response.getReturnValue();

                //alert(rtnValue);

                console.log(rtnValue);

                if (rtnValue == 'Parent' || rtnValue == '' || rtnValue == null) {

                    console.log(rtnValue);

                    //component.set("v.memberShow", rtnValue);

                    //$A.getComponent("memberPage");

                    component.find("memberPage");

                    //component.find('memberPage');

                } else if(rtnValue == 'Volunteer'){

                    console.log(rtnValue);

                    //$A.getComponent("volunteerPage")

                    component.find("volunteerPage");

                    //component.set("showVol",true);

                    //component.set("v.volunteerShow", rtnValue);

                }

            });

            $A.enqueueAction(action);

   

      }

Aura Cmp

<aura:component controller="cqDashboardHandler" implements="forceCommunity:availableForAllPageTypes,flexipage:availableForAllPageTypes" access="global">

    <!-- <aura:if isTrue="{v.showVol}"> -->

  <c:volunteerDashboard aura:id="volunteerPage"  onlogout="{!c.logoutHandler}"/>

  <!-- </aura:if> -->

  <!-- <aura:if isTrue="{v.showMem}"> -->

  <c:memberDashboard aura:id="memberPage"  onlogout="{!c.logoutHandler}"/>

<!-- </aura:if> -->

   <aura:attribute name="recordId" type="String" />

        <aura:handler name="init" value="this" action="{!c.doInit}"/>

    <aura:attribute name="userInfo" type="user"/>  

   

</aura:component>
2 respuestas
  1. 26 feb 2022, 17:57
    I'm not getting any error I want to navigate between to those two LWC components through aura so I need a correct answer if I got rtnValue == 'Parent' then I want to go to <c:memberDashboard/> then if  I got rtnValue == 'Volunteer' then I want to go to <c:volunteerDashboard/>
0/9000