You need to sign in to do that
Don't have an account?
Gaston Lefer
How to display the current user name in lighting?
Just trying to display the current user info on a lightning page
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
apex class controller : lightning component : javaScript controller :
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
http://sfdcmonkey.com
All Answers
apex class controller : lightning component : javaScript controller :
i hope it helps you.
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
http://sfdcmonkey.com
and follow above code :
Thanks let me know if it helps you
thanks
what if there’s an existing @auraenabled class
and aura:handler name="init" value="this" action="{!c.doInit}"/> already day exists? Thanks again
thanks
var userId = $A.get("$SObjectType.CurrentUser.Id");
Console.log(userId);
from http://allaboutlightning.com/get-current-user-id-information-in-lightning/
http://sfdcmonkey.com/2018/01/08/display-current-user-information/
and with below code : you can only get the current user ID, in your client side javaScript controller
I am actually trying to get the contact id at 146 but just even getting the name first wont work
var userId = $A.get("$SObjectType.CurrentUser.Id");
Console.log(userId);
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.get("v.UserName"));
}
})
We can make use of Lightning Data service to access any of the user fields on the Lightning component without need to use apex controller.
Example:
Access the value using the syntax: {!v.currentUser.Profile.Name}