How can I call a codeunit function without triggering the OnRun event?

NAV 2013 R2.

For example, I want to Release a Production order using the change status code unit.

This has OnRun code in it which I do not wish to run. But I do wish to use one of it’s functions.

The only way I see is to copy the code unit to a new one and remove the OnRun Code.

Is there an easier way?

Thanks

Dave K

You an define the codeunit in Global variable (ex: ReleaseProdOrder) and call particular function only

ReleaseProdOrder.Functionname;

Rightly suggested by Mohana. Declare a variable of type CodeUnit in C/AL Globals and point it to the codeunit whose function you want to call. eg CU1. Then call the function you want by adding just one line.
CU1.function_name;
function_name is the name of the function you want to call.