6 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 ‘FirstName.LastName@company.com 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”));
    }
    })
     

Leave a Reply