How to enable or disable an event (event or handler or subscriber) through code in Agile PLM
I have a client who is facing max event issue in one of the utilities he is running on his side. The utility is running as a scheduled event in the night. He assumes it is happening because two other utilities are running at the same time when this utility is running. So he wants to customize through code to disable those two utilities running for a while till this gets completed and then start again. Please help in finding solution for this issue.
As mentioned by Raj, there is no way to disable an event with SDK API. However, I am a bit curious regarding the RCA of the issue. If two events are getting triggered simultaneously, it shouldn’t ideally throw Max Event Level Reached error as per my knowledge, what is can show is Someone is working on this object, please try again later, or There is a newer version of this object, please refresh and try again, like these.
If you really think that multiple scheduled events are causing these, there is one probable solution. In the Task Configuration settings, go to ScheduledEventTask and change Task MaxEventNumber to 1 and see if this resolves the issue.
The most likely cause of Events getting triggered nestedly is poor handling of dirty cells, please have a look there also.
Hope these help.