Question
Bank
CA
Last activity: 21 Mar 2023 13:39 EDT
Automatic User Deletion Based on Last Sign On Time Missing Users
I have a requirement to improve an agent that deletes users by filtering out criteria through an Obj-Browse method and then calculating if they have been signed out for however amount of days, if they have, it deletes them. However it has been missing users (I believe because it only captures the first 1000 people in the work group, and then checks their last sign on time to see if it should delete them, therefore missing the other users it needs to check, since it's only filtering first by the work group and to check if it's not a model user). I cannot seem to figure out how I can accomplish this, at first I tried using the calculation builder inside the Obj-Browse method on the last sign on value so it would only grab users that matched or went over the maximum amount of time allowed but I could not figure out a way to evaluate DateTime's in a way that would accomplish this. I also couldn't figure out a way to configure an RD as two of the values on the user's clipboard that I need for the time calculation couldn't be accessed as a column source. Any advice is much appreciated.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 21 Mar 2023 13:30 EDT
Bits in Glass
IN
@PegaDev9381 I hope you have configured the filter in the below manner. Because I pyLastSignOn property is also Datetime property
@addToDate(@CurrentDateTime(),-46,0,0,0)
NCS Pte. Ltd
SG
Hi @PegaDev9381: I hope you are using pyLastSignon to filter out the users. In such case, you can use the date time values in the filter condition of obj-browse as well as in the RD. You can use functions to calculate the filter date (example which reduces 1 day from current day: @addToDate(@CurrentDateTime(),-1,0,0,0) ). This function can be used in the filter value (or) can be calculated as a parameter and the parameter can be used in the browse method.
For report definitions, you can pass the values in the primary page / parameter / in any top level page.
Thanks.
-
Pega Dev
Updated: 21 Mar 2023 11:00 EDT
Bank
CA
@ArulDevan Hi Arul, I did try to use functions inside the Obj-Browse to sort by pyLastSignOn, however, pyLastSignOn the value is received from the query the Obj-Browse makes itself, but none of them worked as any time I tried to compare DateTime values I got the error "String was not a date *false*" as the DateTime can't be compared to anything but another DateTime, since I need to filter by lastsignon dates that have been inactive for 46 days I couldn't find a way to implement this with the built in functions in calculation builder. Perhaps I am missing something obvious?
Accepted Solution
Updated: 21 Mar 2023 13:30 EDT
Bits in Glass
IN
@PegaDev9381 I hope you have configured the filter in the below manner. Because I pyLastSignOn property is also Datetime property
@addToDate(@CurrentDateTime(),-46,0,0,0)
-
Pega Dev
Bank
CA
@Anoop KrishnaHi Anoop, thanks for your reply. I have configured the condition exactly like yours however I am still getting one error when I run a test through the tracer with the same error code: "1.(Code-Pega-List) String was not a date "false". Additionally I am curious if the condition must be less than or equal to so it can remove users who were missed previously and are still inactive to dates past the 46 days (if they were missed, and are now 56 days old for example)
Bits in Glass
IN
@PegaDev9381 Hello, ya you can give >= 46 days. The page which you have defined in the obj-browse can you give it the same way like below. Can you configure by referring above reply image and below image. Defining a page in pages and classes tab and using that within obj-browse. I have executed the activity and I have got the results.
-
Pega Dev
Updated: 21 Mar 2023 12:15 EDT
Bank
CA
@Anoop Krishna Hi Anoop, thank you again for your continued help. Currently the pages & classes I have are OpID with class Code-Pega-List and OpID.pxResults, the Obj-Browse is using the OpID Page currently with an ObjClass of Data-Admin-Operator-ID, the OpID.pxResults is a step page that checks whether or not a property called OfficerID is blank or not so it doesn't delete test users I believe. I tried implementing your solution by creating a new page, but when running the tracer the application no longer worked (I tried to make a new page called OperatorPage with a class of Data-Admin-Operator-ID but it resulted in the program not running as expected in the tracer) Please let me know if I've made an additional mistake so I can correct it, and thank you again.
Bits in Glass
IN
@PegaDev9381 ok. Hello, can you try one thing. Can you comment all the steps, when condition and everything. Just keep obj-browse, with pylastsignon filter. Just to check how this behaves for you because for me, got the results. The officerID check also can you remove once for now.
-
Pega Dev
Bank
CA
@Anoop Krishna Hi Anoop, thank you so much it seems the issue had to do with not checking in properly, once I followed proper conditions everything is working flawlessly now, thank you so much for your help.
-
Anoop Krishna
Bits in Glass
IN
@PegaDev9381that's great to know 👍
-
Pega Dev