User Logins

Hello, is there a way to see the date a user logged into Sugar for the first time. I know how to get the last login. 

Parents
  • Hey  ,

    It might be possible with Trackers, but even then, Sugar should only keep that information for a period of time (so you won't end up having that information for a while). And also Trackers are normally disabled by default, as there is a global performance hit on the system.

    The solution I would try is to create a code logic hook that copies data from the last_login field only on first login.

    The simplest pseudocode could be:

    If empty first_login_c, use last_login for first_login_c

    or if you want to populate this only for newly created users the pseudocode could be:

    if empty previous value of last_login and not empty current value of last_login (and maybe also double check if empty first_login_c if something else could populate it), use last_login for first_login_c 

    Hope it helps

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

Reply
  • Hey  ,

    It might be possible with Trackers, but even then, Sugar should only keep that information for a period of time (so you won't end up having that information for a while). And also Trackers are normally disabled by default, as there is a global performance hit on the system.

    The solution I would try is to create a code logic hook that copies data from the last_login field only on first login.

    The simplest pseudocode could be:

    If empty first_login_c, use last_login for first_login_c

    or if you want to populate this only for newly created users the pseudocode could be:

    if empty previous value of last_login and not empty current value of last_login (and maybe also double check if empty first_login_c if something else could populate it), use last_login for first_login_c 

    Hope it helps

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

Children