Remove open assignments except the current one
We have a requirement where we need to close all open assignments except the current one. To elaborate on the requirement, lets say, user has opened one assignment of WO ABC-1. Now without submitting the same he clicked on Get Next Work and opened another assignment of say WO ABC-2. So both the assignments are now open to the user.
In this case our requirement is to close the previous assignment (i.e. assignment of ABC-1) when user opens another assignment (i.e. assignment of ABC-2).
To implement this we tried to create an activity that iterate over D_ThreadList.pxResults and for all open Work objects did Obj-Open-By-Handle to create the pyWorkPage, Call Work-.SaveAndContinue and Call Work-.DoClose on the pyWorkPage. But looks like that did not work. When I open the clipboard I can still see the threads of the Work Objects.
In this regard please share your ideas to achieve this at the earliest.
Thanks in advance.