You need to sign in to do that
Don't have an account?
phani_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
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
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
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