7 comments

  • thanks good post piyush soni,
    How to get all list of logged users in Salesforceforce org and Display in Lightning component

  • If email address is ‘[email protected] on user profile, we can fetch the User name from email on user profile without server call.

    Lightning Component :

    <aura:component implements=”flexipage:availableForRecordHome>
    <aura:attribute name=”UserName” type=”String” default=””/>
    </aura:component>

    javaScript controller :

    ({ doInit : function(component, event, helper) {
    var UserName =  $A.get(“$SObjectType.CurrentUser.Email”);
    cmp.set(“v.UserName”,(UserName.substring(0, UserName.lastIndexOf(“@”))));
    alert(cmp.set(“v.UserName”));
    }
    })
     

  • Hello, I am using a very similar code to display the ” Welcome ‘user name’ !” on a community page. it displays the name for Admin Users , but not for everyone. what am I missing? Thank you

Leave a Reply