Hi All
I am using getLastLoginDateTime function which is in the below plugin
Get Last Successful Login Details
But facing weird issue.
below are the code snippet
It is working fine without typecase but while typecast it is showing errorNote :- loginDateTime has date and time data type and it is not working for 2-3 users and for rest it is working fine even while typecast.
Discussion posts and replies are publicly visible
Yogesh,
From your screenshots, it seems like the function is returning the text string and your loginDate field in the CDT is expecting the data and time. Can you please make sure the resultant of your expression be date and time? Let's say convert the resultant to date and time and try the same?
Problem is with what getlastlogindatetime() function is returning. Its returning time in 24 hour format but for some reason, it is appending AM/PM after each result as 24 hour time format is represented without AM/PM.
That's why it couldn't be converted to datetime. So, it will throw error if user's login time is at or after 1 pm. One solution would be to convert 24 hour time to 12 hour.
I'd suggest reporting this as a bug to the plugin's author. In the meantime, something I've done myself in the past to fix a "wonky" datetime value returned by a plug-in like this, was to build a custom expression rule that can consume the incorrect text value and parse it to return the correct dateTime value - it's a lot easier to test that way.
yes I checked those users who login after 1 pm , I am facing issue on those users only