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 8267451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:32:00+00:00 2026-06-08T05:32:00+00:00

To start, we have a product that syncs data to and from salesforce via

  • 0

To start, we have a product that syncs data to and from salesforce via the api. When a record is updating in our platform, the data is pushed to salesforce, when the data is updated in salesforce, it is pushed to our product. The problem we’re running into is an infinite loop that is being rather troublesome. Is there a way in SalesForce to determine who is executing a trigger so that when data is updated in our product and pushed to salesforce, the trigger will not fire? I haven’t seen an execution information about this before so I’m really not sure on it.

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-06-08T05:32:04+00:00Added an answer on June 8, 2026 at 5:32 am

    I don’t believe there is anything beyond Trigger.isExecuting, which simply tells you whether you are already in a trigger context or if you’re coming from Visualforce, the API, or execute anonymous.

    One possible solution is to create a custom field that retains the origin of the most recent update. This can then be used to properly route logic within your triggers and avoid calling out when the last update is from your external system. Additionally you can loop through all fields in your Trigger.old and trigger.new to see which fields changed. This way you can avoid further unnecessary syncs to your external system when nothing interesting actually changed on your record (SystemTimeStamp, LastModifiedDate, etc.) Here’s a sample of how to do this:

    trigger ContactDescribeExample on Contact (before update) 
    {
          // Get describe fields to evaluate old and new triggers with
          Map<String, Schema.SObjectField> fldObjMap = Schema.SObjectType.Contact.fields.getMap();
          List<Schema.SObjectField> fldObjMapValues = fldObjMap.values();
    
          // Flag to determine if field(s) other than FirstName caused this change (FirstName is just an example)
          Boolean hasOtherChange = false;
    
          // Loop through trigger batch
          for(Contact c : Trigger.new)
          {
                for(Schema.SObjectField s : fldObjMapValues)
                {
                      String fldName = s.getDescribe().getName();
    
                      // Filter out fields we're not interested in
                      if(fldName != 'FirstName' && fldName != 'LastModifiedDate' && fldName != 'LastModifiedById' && fldName != 'SystemModstamp')
                      {
                            // Check to see if old and new are different
                            if(c.get(fldName) != Trigger.oldMap.get(c.Id).get(fldName))
                                  hasOtherChange = true;
                      }
                }
          }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two product tables. Table A is the default table (comes from data
I have an app that uses Amazon Product Advertising API at local with no
I have function Start() that is fired on ready. When I click on .ExampleClick
Have a product that belongs to a category. Want to create a promotion for
My company makes a product that connect to the PC via USB. I am
I have been developing a test framework for a particular client/server product (COTS) that
Suppose I have a class that represents a product to be priced using one
I have my Product model that has the attribute private . I want to
I have a bundled Product that contains 3 virtual products as options. I have
I have a product page that loads fine when I type in the www

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.