Wednesday, 10 August 2016

current user

Id profileId=userinfo.getProfileId();
String profileName=[Select Id,Name from Profile where Id=:profileId].Name;
system.debug('ProfileName'+profileName);
public googlePageController(){         PageReference pg = null;                      String usr = AF_DealerCRM_Utility.getUserInfo();         System.debug (' ProfileName: ' + usr); } public string getUserInfo(){                   String usrProfileName = [select u.Profile.Name from User u where u.id = :Userinfo.getUserId()].Profile.Name;       return usrProfileName ;    } (OR) public googlePageController(){         PageReference pg = null;                     User usr = AF_DealerCRM_Utility.getUserInfo();         System.debug (' ProfileName: ' + usr.Profile.Name); } public User getUserInfo(){                User usrProfileName = [select u.Profile.Name from User u where u.id = :Userinfo.getUserId()];       return usrProfileName ;    } please select this as solution if you got your answer.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. global class ScheduleSendAlerts implements Schedulable
    {
    global void Execute (SchedulableContext SC)
    {
    BatchSendEmailAlerts sendalerts = new BatchSendEmailAlerts();
    database.executebatch(sendalerts,50);
    system.debug('In the batch class');
    }
    }

    ReplyDelete