HI
I have to write a trigger which has to be run on Exit of Application. I mean when user close the applicaiton or GP , not the form , trigger has to be fired.
Any idea regarding this.
Thanks in advance
Wajahat
*This post is locked for comments
Hi
Thanks for your support. Right now i am using the follwing scenario. "exitDynamics" of form 'Main Menu' is a procedure which runs on the exit of application and it is GP default procedure . So , now i have inserted the trigger over this. But problem is that trigger is being fired at the right time but i have to run an application and that one is not supported by trigger. I am using the command " run applicaiton (application name) " through dexterity. Its mean trigger is fired but application is not run or trigger is not able to run the command at this level.
I have not checked what happens to the Activity table but I would not be surprised if this idea failed. In many other tables, GP has a habit of adding a record, deleting the record, adding it again, deleting, and then adding. All in one transaction posting. I would not be surprised if you did not get a delete on login, especially if you have to delete user id from a crashed session before signing back on again.
Maybe David will know how to do this correctly.
I'm pretty sure the last table that is updated when a user logs out of GP is the DYNAMICS..ACTIVITY table. The trigger might want to be on Delete. I think the command is something like
DELETE FROM DYNAMICS..ACTIVITY where USERID = '@userid'
(and maybe you need a session id involved too, since a user might have more than one client open, SQLSESID is the field.)
Not sure what happends when they change companies though, it might just be an update statement to change the CMPNYNAM or it might do a delete and then an insert. If it is a delete, then it is possible that you might get false results.
Also, if a user has to force GP closed, often that Activity table will not be properly cleared.
Hopefully this is a start.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156