How to add a case in switch condition in existing class in D365

I have to add one condition in switch case in setQuery method of WHSWorkTemplateTableForm without over layering.

i tried with pre and post event handler but because they are declared queryRun object in method only so every time its going to default condition.

can anyone suggest me how can i write condition without overlayering.

It seems that you’re using an older version of the application. There used to be a switch statement for values of WHSWorkTransType enum, but it’s not there anymore. The logic has been refactored to be extensible, namely it now utilizes the extension framework.

You should upgrade the application to have access to the latest, most extensible code.

Previously you would need to inject code inside the method, which can’t be done with extensions.