web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Trigger on GP Exit

(0) ShareShare
ReportReport
Posted on by 1,502

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

I have the same question (0)
  • K Day Profile Picture
    7,365 on at

     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.

  • Richard Whaley Profile Picture
    25,195 on at

    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.

  • Wajahat Ali Profile Picture
    1,502 on at

    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.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans