Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

EventSubscriber to standard table events are suddenly no longer executed

Posted on by 144

Hi,

wie have problems with EventSubsribers.

For example:
[EventSubscriber(ObjectType::Table, Database::"Item Reference", 'OnBeforeModifyEvent', '', true, false)]
local procedure OnItemReferenceOnBeforeModifyEvent(var Rec: Record "Item Reference")
begin
  Rec.Validate(MyDateField, Today);
end;

We are still in the test phase and we believe that it worked until recently. I'm not sure if it might have something to do with the update from 21.3 OnPrem to 21.6 OnPrem?
It seems that all standard table EventSubscribers are now ignored without errors. The problem seems to affect all table subscribers.

Does anyone have any ideas as to what could be causing this, or is there perhaps even something related to this?

regards
Ralf

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    Thanks for the update.

  • neckit Profile Picture
    neckit 144 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    We found the problem :-)
    It was a license problem! The object numbers used were not included in the BC-OnPrem license. Due to the first parameter of the EventSubsriber, this was ignored without an error messages.

    Until recently we were still programming and testing in the test license and everything was OK there.
    Then the customer licenses were imported and the key users only now noticed that.

    regards
    Ralf

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,296 Super User 2024 Season 2 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    Hi, I'm sorry that I don't have the environment of BC21.6 at present, but I tested it in BC22.1 and it seems that there is no problem.

    pastedimage1684197903009v1.png

    pastedimage1684197923687v2.png

    If this is a standard environment and there are no license issues. I suggest you submit an SR to Microsoft and ask them to assist with the investigation.

    Hope this helps.

    Thanks.

    ZHU

  • neckit Profile Picture
    neckit 144 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    No! As described above: without the message being displayed.

    So the message is not displayed and the code is not run through!

  • Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    so your message is displaying?

  • neckit Profile Picture
    neckit 144 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    I simply added a message box to various EventSubcribers, e.g.: Message('Test1');
    If changes are made, they are accepted without the message being displayed.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    Did you try to debug the problem?

  • neckit Profile Picture
    neckit 144 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    Sorry - that was a typo in the post and I'll correct it right away. Of course, it's correct...event and not...trigger.

    Unfortunately, this does not solve the problem and it also affects many event subscribers, all of which worked before.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: EventSubscriber to standard table events are suddenly no longer executed

    Hi,

    Can you try this Event?

    [EventSubscriber(ObjectType::Table, Database::"Item Reference", 'OnBeforeModifyEvent', '', true, false)]

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans