Close Menu
MyKnowTech
    MyKnowTech
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services
    LinkedIn YouTube Facebook
    MyKnowTech
    Videos

    Understanding Declare Trigger in Pega

    Editorial TeamBy Editorial TeamMay 25, 2026Updated:May 26, 2026No Comments4 Mins Read
    Share LinkedIn Telegram Email WhatsApp Copy Link

    Declare trigger is the third in the declare rules series, alongside declare expressions and declare onchange. The key distinction from declare onchange is what it watches.

    Declare onchange uses forward chaining to watch property values. Declare trigger watches transactions – specifically, what happens when a case instance is saved, deleted or committed.

    The Five Trigger Conditions

    A declare trigger fires based on one of five transaction events.

    Saved – when an instance is saved using a deferred OBJ save (without write now). The change is in memory but not yet committed to the database.

    Deleted – when an instance is deleted using a deferred OBJ delete.

    Committed Saved – when a save has been committed to the database. This fires after the actual database write.

    Committed Deleted – when a deletion has been committed.

    Saved and One of the Properties Were Modified – this is where declare trigger overlaps with declare onchange. You specify which properties to watch, and the trigger only fires when one of those properties changes and the instance is saved.

    For most use cases, committed save is the right choice – you want to react after the data is actually persisted, not before.

    Watching Properties

    When you use the fifth option, you specify the properties to monitor. If the customer type property changes and the instance is saved, the declare trigger fires. You can also copy the old property value to another property before the update overwrites it – useful when you want to compare old and new values in your trigger activity.

    You can also add a when condition to control whether the activity executes. Not every property change needs to trigger the same action. The when condition lets you be specific.

    The Trigger Activity

    The activity you configure must be of type declare trigger. You can execute it immediately in the current request or run it in the background as a child request. Background execution is the right choice for anything that might take time or involve external calls.

    Field Level Auditing

    The most common out-of-the-box use of declare triggers is field level auditing. You enable it from the case designer under Settings – Auditing – Field Level Auditing. Select the properties you want to track and save.

    Pega automatically creates a declare trigger for you, wired to an out-of-the-box activity that captures property changes and writes them as history entries on the case. It also creates a data transform that lists all the watched properties – you will see it update automatically as you add more properties to track.

    When users change a tracked property, the audit trail is visible in the Field Histories tab on the case. Each entry shows the old value, the new value and when the change happened.

    Real Project Uses

    Case dependency is a well-known use of declare triggers. When a child case reaches a certain status, a declare trigger fires an activity that checks whether the parent case can resume – this is what drives Pega’s wait shape resolution under the hood.

    Field level auditing, case dependency management and any scenario where you need to react to committed database changes are all natural fits for declare trigger.

    Watch the Full Walkthrough

    In the video below I walk through the declare trigger configurations, enable field level auditing on a claims request case, track two properties, create a test case and verify the audit history shows the correct old and new values.

    Declare trigger is one of those rules you will encounter on most enterprise Pega projects. Field level auditing alone is a common requirement. Understanding how the trigger conditions work means you can use it confidently beyond the out-of-the-box scenarios.

    Advanced
    Editorial Team

    An insightful team dedicated to empowering the Pega ecosystem with in-depth knowledge, guided by Premkumar Ganesan's vision.

    Related Posts

    Videos

    Application URL Alias in Pega

    May 25, 2026
    Videos

    Understanding Components in Pega

    May 25, 2026
    Videos

    Understanding CORS Policy in Pega

    May 25, 2026
    Videos

    Content Security Policy in Pega

    May 25, 2026
    Videos

    Five Best Practices for Creating Connectors in Pega

    May 25, 2026
    Videos

    How to Plan a Pega Upgrade – A Practical Guide

    May 25, 2026
    Videos

    How to Analyse a Heap Dump in Pega

    May 25, 2026
    Videos

    How to Store Case Attachments in External File Storage in Pega

    May 25, 2026
    Videos

    Data Encryption in Pega Using HashiCorp Vault

    May 25, 2026
    Videos

    Understanding Stack Memory in Pega

    May 25, 2026
    Search through the blog
    Tags
    activity Advanced authentication background-processing Beginner case-management Constellation data-model declarative-processing email-processing file-processing Integration pega-core-concepts pega-integration process reporting security system-administration user-interface validation
    Pega Courses

    Pega courses can be accessed at https://myknowacademy.com

    About

    MyKnowTech is a boutique Pega enablement and consulting firm – helping organizations build internal Pega capability through structured training programs, Centre of Excellence setup and hands-on architecture guidance.

    Company
    • About
    • Leadership
    • Career
    • Contact
    Resources
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services

    ©  MyKnowTech B.V. All Rights Reserved.

    • Sitemap
    • Terms & Conditions
    • Privacy Policy