Skip to main content

#Salesforce167 debatiendo

Hi Everyone, 

 

I’m working on a scenario where an Opportunity trigger updates the related Account

, and an Account trigger in turn performs some additional updates. 

 

What would be the best approach to prevent trigger recursion

while keeping the solution bulkified and scalable? Would a static variable-based approach be sufficient, or is there a better Trigger Handler pattern for managing this? 

 

Looking forward to your recommendations and real-time implementation approaches. 

 

Thanks!  

 

#Salesforce  #Salesforce Developer  #Apex  #Trailhead

3 respuestas
  1. Hoy, 4:37

    @Deepak Sharma 

    Best practice is a Trigger Handler pattern with controlled recursion, rather than relying only on a static Boolean. 

    •  Keep triggers thin and move logic into handler/service classes
    •  Use a static Set<Id> to track records already processed in the current transaction. 
    •  Keep all logic bulkified—use collections and avoid SOQL/DML inside loops. 
    •  Add clear entry conditions so updates only happen when relevant fields actually change. 

     

    A static Boolean can work for simple cases, but a

    Set<Id> + Handler pattern

    is more scalable for complex automation. 

     

0/9000

Hello Trailblazers, 

 

Navigating the Data 360 credit consumption model can be challenging when trying to map overall credit usage back to specific transforms, refreshes, or pipeline resources.

To help address this gap, I recently authored an article for the Salesforce Architects blog outlining a practical credit feedback loop designed to help you:

  • Test Build Logic: Validate transforms against filtered data before running full-scale datasets.
  • Pinpoint Usage: Trace consumption back to specific architecture components rather than relying on aggregate totals.
  • Right-Size Cadence: Align refresh schedules directly with business requirements to avoid unnecessary credit burn.
  • Architect Visibility: Embed credit monitoring directly into your system design from day one.

📖 Read the full article: https://sforce.co/4A0Ae46

How is your team currently tracking and optimizing Data 360 credit usage in your architecture? I’d love to connect and hear your approaches in the comments!  

#Data360  #Salesforce Admin #Salesforce #Data Management #Data Cloud 

0/9000

G2’s Fall 2026 Reports are here, and Salesforce Customer Success is proving that consistency is key by ranking #1 in Top Services and #4 in Top Products for the second straight quarter.

 

G2’s Fall 2026 Reports are here, and Salesforce Customer Success is proving that consistency is key by ranking #1 in Top Services and #4 in Top Products for the second straight quarter. 🔑

 

Unlock the full report: https://sfdc.co/G2-Fall26-Reports

 

#Salesforce #TrailblazerCommunity

0/9000

We’re really hitting our stride! 👟 Join instructor Jake Emrich for the Advanced Administrator bootcamp on September 12-14 and power through complex configurations, security models, and process automa

 

We’re really hitting our #TrailblazerTrackMeets stride! 👟

 

Join instructor Jake Emrich for the Advanced Administrator bootcamp on September 12-14 and power through complex configurations, security models, and process automation to maintain your momentum.

 

Lock in: https://sfdc.co/DF26TrailblazerBootcamp

 

@* Trailhead Official * @* Trailhead Academy * @Trailblazer Community Cove @* Salesforce Administrators * #Salesforce #Certifications #Trailhead #TrailblazerCommunity #Flow #Salesforce Admin #AwesomeAdmins 

0/9000

 An organization wants to automatically maintain an Account's Customer_Tier__c based on its Opportunities.  

 

Rules: 

  •  If Account has at least one Closed Won Opportunity with Amount >= $100,000, set Customer_Tier__c = 'Platinum'. 
  •  If it has a Closed Won Opportunity with Amount between $50,000–$99,999, set it to Gold. 
  •  Otherwise, set it to Silver. 
  •  The logic must work when Opportunities are inserted, updated, deleted, or undeleted. 
  •  It must handle bulk transactions. 
  •  No SOQL/DML inside loops. 
  •  The solution should use a Trigger Handler pattern.

Q.  How would you design this trigger and handler? Which trigger events would you use, and how would you efficiently recalculate the Account tier when an Opportunity is deleted or its Amount/Stage changes? 

  

 

#Salesforce Developer  #Apex  #Salesforce

3 respuestas
  1. Ayer, 6:19

    @Deepak Sharma

    I would use an after-trigger for all four events because the Account tier depends on the current set of Opportunities. Insert and undelete can introduce a qualifying Opportunity, update can change Amount, Stage, or Account, and delete can remove the Opportunity that previously determined the tier.  

    For update, I collect both the old and new Account IDs so that an Opportunity moving between Accounts recalculates both Accounts.  

    The handler passes a Set of Account IDs to a service class, which performs bulk SOQL, calculates the highest applicable tier in memory, and performs a single bulk Account update. This avoids SOQL and DML inside loops and handles bulk transactions safely.  

0/9000

Hello.  

We have turned on Account Plans in our Sandbox environment. For the Relationship Map we would like to somehow show a parallel org chart. For example. The CEO of Google and the CEO of our company Syska Hennessy Group. Is this possible?  

 

It seems that the native Salesforce Account plans is limited regarding customization.  

Please let me know if further information is needed.  

 

Is there another account plans tool that is recommended that offers more flexibility to make customizations? 

 

Thank you,  

Nancy 

 

 

 

#Account Planning  #Salesforce Admin  #Systems Administrator  #Salesforce  #Salesforce Developer  #Salesforce Field Service  #Salesforcecommunity  #Salesforceadmins

1 respuesta
  1. Eric Burté (DEVOTEAM) Forum Ambassador
    Ayer, 21:09

    Hello @Nancy Magalhaes

    all components I know focus on displaying the concerned account org hierarchy. I am not aware of any component displaying both in the same page. Maybe you would need a custom lightning page and 2 components (one for the current record organization), one displaying your company organization, but in this case how to link both trees, or make one scroll if I scroll in the other one... I think that the solution  would be to enrich contact records with proper contact owner (or another user lookup field) to display on your component. That works on 1..1 case ; for 1..N links that will not be enough... 

    Eric

0/9000

Need a rest day? 😮‍💨 Us too, and what better way to spend it than playing a game of ping-pong?

 

Need a #TrailblazerTrackMeets rest day? 😮‍💨 Us too, and what better way to spend it than playing a game of ping-pong? 🏓

 

Instructor Stuart Werner is ready to serve up some knowledge at the Agentforce Service Specialist bootcamp on September 12-14. Join him and learn how to build, customize, and deploy AI-powered service agents from scratch, all while bouncing ideas off your fellow Trailblazers as you go. 

 

Let’s rally: https://sfdc.co/DF26TrailblazerBootcamp

 

@* Trailhead Official * @* Trailhead Academy * @Trailblazer Community Cove @* Salesforce Developers * @Agentblazer Community Group #Salesforce #Certifications #Trailhead #TrailblazerCommunity #Agentforce #Salesforce Developer

0/9000

Hi All, 

 

Has anyone done integrating Marketo with Salesforce using the API Only Integration user profile?  

We have a lot of our integrations using this special integration user profile/license and we make a permission set which requires all the objects/fields/system permissions and assign to this integration user.  I am wondering if anyone has tried this integration user for Marketo.  

 

Appreciate your thoughts, 

Thanks! 

 

#Salesforce Developer  #Salesforce Admin  #Integration  #TrailblazerCommunity  #Trailhead  #Salesforce

3 respuestas
  1. Ayer, 13:08

    Good question, and the key distinction is that it is a license-level limit, not a permission one. A permission set can only grant access to objects your license already includes, it cannot add objects the license leaves out. 

     

    The Salesforce Integration (API-only) license deliberately omits full standard-CRM-object access. In practice, when you build the permission set for that user, the standard objects Marketo needs (Account, Contact, Lead, Account Contact Relationship) are not even available to grant, because the license does not include them. So the permission set looks complete, but the user still cannot query those objects and the sync fails on exactly those (Account Contact Relationship is usually the first casualty). 

     

    Marketo's sync reads the whole standard object model (Leads, Contacts, Accounts, Opportunities, Campaigns, Campaign Members and their relationships), so it needs a license tier that actually includes all of them. That is why Adobe specifies User License Salesforce plus API Enabled, it is the only combination that exposes the full set. The integration license is not a cheaper full license, it is a different tier with those objects gated out. 

     

    if this helps, please mark it as the Best Answer so it helps the next person, thanks 🙂

0/9000

Encountering a hurdle? 🚧 Pass the baton to an instructor like Teo Marcelo! “I recently learned how to migrate flows between orgs using Command-Line Interface (CLI) because a customer asked,” he said.

 

Encountering a hurdle? 🚧 Pass the baton to an instructor like Teo Marcelo!

 

“I recently learned how to migrate flows between orgs using Command-Line Interface (CLI) because a customer asked,” he said. “I'd never used CLI before then, but with a few tries, we were able to migrate everything we did in class to their development org in about 20 minutes. It was awesome!”

 

Join Teo for the Admin Flow Builder bootcamp on September 12-14 and learn how to design automated no-code solutions with Salesforce Flow.

 

Make the jump: https://sfdc.co/DF26TrailblazerBootcamp

 

#TrailblazerTrackMeets

 

@* Trailhead Official * @* Trailhead Academy * @Trailblazer Community Cove @* Salesforce Administrators * #Salesforce #Certifications #Trailhead #TrailblazerCommunity #Salesforce Admin #AwesomeAdmins #Flow

0/9000

Welcome to the #TrailblazerCommunity! 👋 Take a moment to introduce yourself below. 💙 

 

Tell us all about YOU:

What are you passionate about? 

What are you looking to learn? 

Where are you located? 

 

Feel free to connect with others in the thread! 👇 

 

UPDATE: To mute this post, click on the arrow on the top right then "Mute."

2014 comentarios
0/9000