Issue #20628:move event creation from trigger to function and add BySO a...

...rg