Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Trigger Order and Trigger_RegisterProcedure

(0) ShareShare
ReportReport
Posted on by 308

Hey All:

I am developing a product where I've got multiple procedures tied to the "Add_Successful_Login_Record" script, and I've got a couple of questions that I haven't seemed to be able to answer.

1) do the triggers fire in the order that is returned from the Trigger_RegisterProcedure function?  The reason I need to know the order is because I have a program that a) checks to ensure that all of its tables are available, and b) requires immediate knowledge of who logged in.  I'm getting weird errors with things trying to fire backwards on me, and figured it would be best to find out the answer to this one before I burn hours debugging my code.

2) is there - anywhere - recorded a list of the [core] scripts that fire and in what order?  In the documentation, I've seen one attached to "Security", and thanks to David I found a better candidate for one of my scripts in Trigger_RegisterFocus(anonymous(form Toolbar)) [which if anyone is interested will allow you to peg out when a new user is logged in after one is already logged in.  Sorry, I don't have a link to the original.]  But I haven't seen anywhere a list of what we can (and should) attach to for various purposes.

Thanks all!  This forum has certainly made me a better coder!

-J

Categories:
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Trigger Order and Trigger_RegisterProcedure

    James

    You can log scripts to see what scripts are running.

    If you want to know the order that the triggers registered against a script run in. It would be the trigger tag order.

    Regards

    David

  • James McCullough Profile Picture
    James McCullough 308 on at
    RE: Trigger Order and Trigger_RegisterProcedure

    [My question varies a little from what was asked.  If you don't mind, take a look at my other post?]

    Thank you very much David.  You know more about my situation than I posted here, and honestly, my question was more generic than my situation.  This was an amazing idea though, thank you!

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Trigger Order and Trigger_RegisterProcedure

    Hi James

    Triggers registered on the same script fire in the order they were registered.

    Normally they are registered from the startup script which is executed in the order they are in the Dynamics.set launch file.

    A solution for you would be to have your product manager register a trigger against Add_Successful_Login. It then does its stuff and then calls a placeholder procedure in its dictionary.

    Your additional products then trigger on this placeholder procedure using cross dictionary triggers.

    This would allow all your products to run code on login, but ensure the product manager runs first.

    Thoughts?

    David

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans