Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6791101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:48:19+00:00 2026-05-26T17:48:19+00:00

I have couple of objects(1 custom object called appointment and event object) which i

  • 0

I have couple of objects(1 custom object called appointment and event object) which i am trying to syncronize. So i have 1 trigger each on each object which searches and updates the records. The issue is, these triggers will keep running recursively as everytime an appointmet is updated the event is also updated and the triggers keep firing and ofcourse salesforce does not accept it.

Any idea how to overcome this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:48:19+00:00Added an answer on May 26, 2026 at 5:48 pm

    Easiest way is to have an apex class containing a static boolean variable initialised to false. Then in each of your triggers you would check the state of this variable:

    trigger MyTrigger on MyObject (after update)
    {
        if(CStaticTracker.bHasTriggerFired == false)
        {
            CStaticTracker.bHasTriggerFired = true;
    
            // do your work and update the other object here
    
            // shouldn't need this but let's play safe!
            CStaticTracker.bHasTriggerFired = false;
        }
    }
    

    The upshot being, of course, that when one of the triggers runs it’ll set this variable to true, and prevent the recursive trigger from executing whatever logic is contained within the if statement. Of course this can still cause some cascading, but it will stop as soon as you don’t call another update in one of the triggers.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an simple custom object called MyObject (a couple of basic properties and
I have a couple of javascript objects that each have a setup method. The
Say I have a couple of basic objects like so: [Serializable] public class Base
I have a couple questions about creating a object (2 values) and how to
Here's the problem: I have couple of pages which gets its content from a
I have a couple of files containing a value in each line. EDIT :
I have an object that has an NSMutableArray of custom UIViews, a UIImage, and
I have a Repeater contol bound to a custom object (an EntitySpaces query) and
I have a WCF REST service that exposes a couple dozen objects and based
I have a couple of custom DialogPreference implementations floating around, such as this one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.