How can I set a trigger on a kdb table?

Triggers went away in k4; kdb does not provide a table trigger mechanism. However, your needs may be satisfied with views and/or the function .z.vs