function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
phani_mphani_m 

About login and logout details

  Hai............. Iam new to salesforce 

 

 

                           I need to get the login and logout details of each user in our organistion i.e (professional edition) and i need to get the logged in (hours) of each user. 

 

  How can i ger those things whether i need to write Apex code or is there any better way  to get those results. 

 

Any one help me

 

Sridhar BonagiriSridhar Bonagiri

Hi,

 

I think Salesforce is already providing some standard reports that suits your requirement and there is no need for you to write the apex coding for this.

 

Regards,

Sridhar Bonagiri

If this post is your solution, kindly mark this as the solution and give Kudos

AshishyadavAshishyadav
You can create a report on user there you can add two columns login date and last login to access the login details of the user.
Whiile creating report select New Login Locations
or other thing what you can do is that you create a report and select USERS as report type and in that there are fields call Login history you can select approprite field from there.
I hope it helps
phani_mphani_m
Hai Ashish Thanks for giving the information i had another problem , In professional edition we don't have the workflow rule then how can we create that kind of thing. Actually i need to send an email to CEO daily an email with all the details like(users login details,no of clicks done by the user and reports,dashboards ) . How can i do this is there any option like writing Apex code or any solution.
sandeep@Salesforcesandeep@Salesforce

Yes There is a way to do this without using work flow. 

 

You need to write code for this in apex batch class and need to schedule this class as per your requirement. You may find code for this very commonly. like this: 

 

Email code : 

List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
for(User portalUser :lstPortalUser)
{
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
string body = 'Hi '+ portalUser.LastName;
mail.setSubject('Test Subject');
mail.setTargetObjectId(portalUser.Id);
mail.setSaveAsActivity(false);
mail.setHtmlBody(body);
mails.add(mail);
}
Messaging.sendEmail(mails);

 

and now keep this code in batch class and schedule it.

 

Please mark this as solution and give kudos if you get any help