Event Subscriptions Stopped Working!

  • Event Subscriptions Stopped Working!

    Posted by Jason Wilder on April 3, 2017 at 10:28 am
    • Jason Wilder

      Member

      April 3, 2017 at 10:28 AM

      We had a scenario where our event subscriptions stopped working.  Pretty weird isn’t it?  Also dangerous as basically this means some of your business logic is no longer running.  Here is the backstory and a work around to ensure this does not happen:

      We have 3 Service Tiers on separate machines (I won’t go into why we use three) :
      1) Client Services (runs our 65 user sessions via Windows Client)
      2) Web Services (runs 3 integration’s: Website, CRM, Warehouse Mgt)
      3) NAS + Job Scheduler (5 dedicated background sessions for integration’s, 3 job queue sessions running hundreds of jobs)

      We just recently (Jan 2017) upgraded from NAV 2009 R2 Classic to NAV 2016.  During this upgrade I moved a bunch our our custom OnInsert/Modify/Delete and OnValidate code from the tables to work via Event Subscriptions.

      On Thursday evening last week I imported 5 objects into our database via the Development Environment (one was table 311 Sales & Receivables Setup which had a new Blob field added to it, the rest were pages).  My normal process is to Stop and Start the Service Tier for Web Services and NAS.  If I don’t do this I would get an error “Metadata is not in sync for table with ID XXX ”  from these services tiers.  I typically (depends on what I am importing) do not restart our Client Service tier as this would kick users out of their session. 

      On Friday morning when I came in I had some alerts sitting in my e-mail inbox.  One of these alerts checks that certain fields are filled in on the Sales Header (such as Creation Dates and User ID’s) and it looked like any new orders entered by a user had certain fields not filled in.  Also a user sitting near me told me she had to change a field that she has never had to touch before to get an order released.  Within a few minutes I was able to trace things down to any of our custom code done via event subscriptions was not running.  We have one codeunit that holds all of this code and it hadn’t been changed in months. 

      There is a command called UNBINDSUBSCRIPTION that could possibly cause this problem but I have no code that uses that functionality so I quickly ruled that out.  My only other option that I could think of was to restart the Client Services Service Tier.  I did this and problem was solved.  It left us a small mess as now I had Sales Orders that in a way were only partially entered as the normal code that runs, didn’t.

      The moral of the story is that I would restart each service tier (even Client Services) when you are making object changes or you may run into this same issue we had.  I suspect it had to do with the table change, maybe even because I added a Blob field which is pretty rare.  Has anyone else who uses event subscriptions experienced anything like this?

      ——————————
      Jason Wilder
      Senior Application Developer
      Stonewall Kitchen
      York ME
      ——————————

    • David Wiser

      Member

      April 3, 2017 at 1:48 PM

      We have had issues with them stopping also.  We just recompile the event codeunits and that seems to solve the issue for us.

      ——————————
      Dave Wiser
      Controller
      Beckwith & Kuffel
      Seattle WA
      ——————————
      ——————————————-

    • Dave Cintron

      Member

      April 4, 2017 at 12:08 PM

      Jason,

      When you import objects to NAV from another database you must always recompile. Restarting the service tiers will clear the object cache but the metadata may still be out of sync, especially for table modifications.

      ——————————
      Dave Cintron
      Dynamics West
      Ventura CA
      ——————————
      ——————————————-

    Jason Wilder replied 9 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Event Subscriptions Stopped Working!’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!