APEX SALESFORCE Visual Force Visualforce

How to Get the Logged in User Profile Name in Apex Class and Visualforce Page

How to Get the Logged in User Profile Name in Apex Class and Visualforce Page Source: https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_userinfo.htm#apex_System_UserInfo_getProfileId getProfileId() Returns the context user’s profile ID. Id profileId=userinfo.getProfileId(); String profileName=[Select Id,Name from Profile where Id=:profileId].Name; system.debug(‘ProfileName::’+profileName); its possible to get the profile…

Read More
APEX SALESFORCE Salesforce Customization Salesforce.com SOQL

How to get the Current Date and Year Using Apex Class?

How to get the Current Date and Year Using Apex Class? System.debug(‘************ ‘ + system.today().format()); System.debug(‘************ ‘ + date.today().format()); Output:- ************ 07/16/2014 ************ 07/16/2014 How to get current year using Apex in Salesforce? Integer Year = Date.Today().Year(); Output:- ************ 2014…

Read More