Question

I need to create a trigger function that would be called whenever i insert or delete data to my table. Internally cache keeps the data in a global. in the reverse way i can add data directly to the Global and i can view it in the table. The trigger function works fine when i insert data using SQL Statement(Insert into). But it fails to call when i add directly to the global. so,how can i make triggers to be called when i add data to the Global directly. instead adding it using query (Insert into TABLE).

Was it helpful?

Solution

If you use the class to add data in the global, then you can use the Callback methods. For example %OnAfterSave does what you want.

On the other hand if you put data directly into the global then you will need some way to track when data is added. You can do this by writing your own agent or by doing what is adviced in this post: How can i make copy of a global automatically in my local system? (this is the link referenced in that answer) http://docs.intersystems.com/cache20141/csp/docbook/DocBook.UI.Page.cls?KEY=GCDI_journal#GCDI_journal_util_ZJRNFILT

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top