I have a class TGB-HRApps-Work-Candidate, In this class I have created some cases(C-1,C-2 and etc..).
If Anyone delete any case(assume C-1) I wants to see information like operator who deleted the case and pzInsKey of the case.
How we can achieve this?
We can configure declare trigger rule , which will trigger whenever a instance is delete in the class.
In trigger activity we can add steps to save those details.
Lets do this practically
In below image we can see the list of case id available in candidate class.
In the same class I am creating a Declare trigger rule.
From the list of option available , I am selecting Commited Save so whenever I am doing delete and commit this declare trigger rule(MonitorDelete) will trigger.
When try to save a error message displayed . It is mentioning that Trigger activity is not of type trigger.
Updated the activity type to trigger.
Now can able to save the rule.
Created a data class to store the deletion details.
Created 3 properties in this class.
Click on the below highlighted button to create local table .
Added Key for class.
So lets configure the trigger activity steps. Below is the list of steps in the activity.
Pages and class tab:
In the first step we are checking whether pxInsKey has values are not. If it has values then only we are allowing to execute the activity.
Lets check the work we have done.
Created a sample activity to delete the instance.
Ran this activity and traced it.
In the above image you can able to see the declare trigger was triggered on the deletion and its activity got executed.
In the table you can able to view who deleted and which pzInskey got deleted .
Thank you for reading this post. If you have any doubts please ask in comment.
Reference:
Pega help file: