Page 1 of 1

Exception 1066 Notification not set for this OID

Posted: Mon Jul 22, 2024 1:11 pm
by Michael.Duraj
Hi Is it possible to detect if an endClassNotification(<ClassName>, false, Any_System_Event);

Will throw a Exception 1066 Notification not set for this OID ?

Re: Exception 1066 Notification not set for this OID

Posted: Mon Jul 22, 2024 4:38 pm
by BeeJay
Depending on what you're trying to achieve could use either of the following options to avoid a 1066 from being reported to your end users:

1. If it's possible that the beginClassNotification was never executed at the time your code is calling endClassNotification, and that is a valid situation for the code path in question, then arm an exception handler immediately prior to the endClassNotification to trap the 1066 exception and return Ex_Resume_Next from the exception handler. But only do this if it is valid for the beginClassNotification not to have been executed so you don't hide a potential coding bug.

2. If this is in say the unload of a form, to avoid subsequent 1227 notification subscriber not found exceptions, and you're therefore ending all notifications which "may have been armed" during the lifetime of the form, you could code the following which will end all registered notifications for that form without getting a 1066 exception if there are currently no registered notifications:
ㅤㅤ

Code: Select all

self.endNotificationForSubscriber( self );
ㅤㅤ
Cheers,
BeeJay.

Re: Exception 1066 Notification not set for this OID

Posted: Tue Jul 23, 2024 4:42 pm
by Michael.Duraj
Thanks BeeJay

Had some performance issues due to an over notification in sysNotifty() and was using causeEvent() and userNotifty() turn on/off (beginClassNotification/endClassNotification) programatically.

I think causeEvent() needs an doWindowEvents(0); after the call... other than a bug I could not see