Skip to main content

#Flows43 debatiendo

#Trailhead #Salesforce Admin #Flows

 

Suppose a business requires the Account's Customer Status to update automatically whenever a related Opportunity is marked as Closed Won. How would you implement this requirement using Salesforce Flow? Which Flow type would you choose, and why?

2 respuestas
  1. 13 oct, 08:55

    Hi @Pranay yerragunta I would recommend using an After-Save Record-Triggered Flow because we need to update a related Account record.

    Implementation Steps:

    1. Go to Setup → Flows → New Flow → Record-Triggered Flow.
    2. Select Opportunity as the object.
    3. Set the condition: Stage = Closed Won.
    4. Choose Only when a record is updated to meet the condition requirements.
    5. Select After Save (Actions and Related Records).
    6. Add an Update Records element to update the related Account using $Record.AccountId.
    7. Set Customer Status = Active Customer (or the required business value).
    8. Save, Activate, and Test the Flow.

    Why After-Save Flow?

    • Before-Save Flow is mainly used to update fields on the triggering record.
    • After-Save Flow supports updating related records.
    • No Apex code is required for this straightforward requirement.

    Best Practice: Test with multiple Opportunities and confirm the Account status updates correctly when an Opportunity changes to Closed Won.

0/9000
Nikolai Hoffmann preguntó en #Flow

Since the Winter '27 release, we are unable to debug active flows versions. 

The only way to debug an active flow version is to create a new flow version and enter test mode. 

This help article somewhat confirms that behaviour and suggests to use Agentforce for debugging: 

https://help.salesforce.com/s/articleView?id=platform.flow_concepts_testing.htm&type=5

 

This is not an option for us. 

This is the header for an active flow version. 

No option for test mode.

How to debug an active flow version?

 

Are we missing anything? 

 

 

#Flow  #Flows

4 respuestas
0/9000

We have a process we're updating that involves sending out an automated email when a new record is created on a custom object.  Everything tested out in Sandbox, but when migrated to Prod, two slightly different emails are triggering when I test.  Talking with the internal customer, they said, "Yeah, that's always been going out," but they don't know who originally set it up.   

 

  • It would have been set some time before me...but it's not triggering in Preprod, which has been refreshed recently - so I'd think it would.
  • Checking Flow triggers, the only other flow triggering off of that custom object updates a field - there are no send email elements to it.
  • I don't see any legacy email alerts or Workflow actions for it
  • I turned off my Flow, opened a debug log on the automated process user, and nothing generated when I triggered that mystery email (that still came through.)

 

I'm kind of at a loss to figure out where to check from here. 

 

#Flows  #Email  #Flow  #Automation

3 respuestas
  1. Smitha Thomas (CIBC) Forum Ambassador
    5 oct, 23:27

    Hi @Nich Weidman

     

    When Salesforce sends a system email, it includes special header fields that identify the source organization and user. To identify the source, locate the following fields in the raw email headers:

    • X-SFDC-LK — The Salesforce Organization ID (the 15- or 18-character org ID of the org that sent the email).
    • X-SFDC-User — The Salesforce User ID of the user whose automation triggered the email.
    • X-SFDC-EntityId — The record ID of the Salesforce entity (such as a workflow rule or report) that triggered the email.
    • X-SFDC-Emailcategory — The category of the email (for example, workflow, report, or Chatter digest).
    • X-SFDC-ORGTYPE — The type of org that sent the email. Note: this field only appears in emails sent from Free or Trial orgs. It does not appear for production, sandbox, or developer org emails.

    Important:

    Use the original .msg formatted email — not a forwarded copy. Forwarding an email overwrites the original headers, making it impossible to identify the source org. 

     

    Find the User Id from

    X-SFDC-User

    then go to set up and add a Debug trace for the user and then triggert the email. This will create a debug log for you to read and find the source. 

     

    Check out these articles for more info:

    1. Find the email headers for emails
    2. How to Identify the Salesforce Organization That Sent a System Notification Email 

       

0/9000

I have a flow that creates a Conversion Event record (custom object) whenever a Campaign Line (CLN) record (related custom object) is created (via the Clone button). Typically, there are multiple Conversion Events, which are auto-numbered, related to a CLN. The intention of the flow is to clone/copy over those Conversion Events from the old CLN to the new cloned CLN without the user having to recreate them.  

In the flow, I use a Get Records to pull all the Conversion Event info from the previous CLNs and then loop through all the records and use an Assignment to assign the values to the field variables and a Collection to hold all of the newly created records. However, I have one field, a picklist that is just a list of numbers 1-20, that doesn't always pull the number from the looped records and populate in the new Conversion Event record. 

Does anyone know why this would happen and how it can be fixed? I'm wondering if there is something nuanced about using numbers in a picklist that I don't know about? 

Thanks! 

 

#Flow  #Flows

3 respuestas
  1. 2 oct, 05:33

     Hii Lisa,

     

    The 1–20 picklist values are not the issue. I would check the Flow’s loop or assignment

    pattern first.

    Make sure the picklist is assigned directly from Current Item from Loop to the new record variable, then add that record variable to the collection. Create the records after the loop, not inside it. Salesforce specifically recommends this pattern because the Current Item is reset on each iteration.

    Also verify that the picklist values are "Active" and available for the target "Record Type"

     (and controlling value, if it’s dependent). 

     

    Check this for references: 

     https://trailhead.salesforce.com/content/learn/modules/loops-in-flow-builder/build-a-loop

     

    https://help.salesforce.com/s/articleView?id=platform.troubleshoot_picklist_values.htm&type=5

0/9000

I’m working with a Salesforce Flow that processes a relatively large number of records, and I’m looking for ways to improve its performance and reliability. 

 

The Flow currently performs several record queries and updates during execution. As the amount of data increases

,

the Flow takes longer to complete and can sometimes approach Salesforce governor limits. 

 

What are some recommended approaches for optimizing a Flow in this situation? For example, would reducing Get Records operations, using collections more effectively, or moving some logic to Apex help? 

 

I’d appreciate any practical suggestions or best practices for designing scalable Salesforce Flows. 

 

#Salesforce Platform  #*saleforce Platform Basic* - Understand The Salesforce Architecture  #Flows  #Slack Developers  #Automation

3 respuestas
  1. 29 sept, 10:31

    Hi @James K.k

     

     

    The biggest win is usually reducing database operations, not just reducing Flow elements.

    I’d bulkify the Flow around collections, eliminate Get Records/DML inside loops, and query only the fields/records actually needed. If the volume or logic still pushes governor limits, I’d move that part to Apex and let Flow handle the orchestration.

0/9000

Salesforce doesn't have a good way to assign a price book to a specific account. My research indicates I can set up a flow that would do this. I am confused on how to set up the conditions need to to pull in the price book to the opportunity when it is created or updated. 

 

#Trailhead Challenges  #Flows

4 respuestas
  1. 29 sept, 07:08

    Hi @Stephanie Huffman

     

    Yes, you can use a Record-Triggered Flow on Opportunity to assign the Price Book. Trigger it when the Opportunity is created or its Account changes. Use Get Records to find the Price Book related to the Account, then update the Opportunity’s `Pricebook2Id`. If multiple Price Books are used, store the Account-to-Price Book mapping in a custom field or object. This will automatically assign the correct Price Book. 

    If this answer is Helpful for You Please Mark as Best Answer. 

     

0/9000

I have a screen flow that I'd like users to be able to access two different ways: from a field on the Opportunity Product object, as well as a Detail Page Button. What's paramount is where the screen flow returns at its end: I need it to end on a view of the product related list on the related Opportunity record. I got it to work successfully on the field version. Here's my formula field:  

 

HYPERLINK("/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product" &"?recordId=" &Id &"&retURL=/lightning/r/Opportunity/" & OpportunityId & "/related/OpportunityLineItems/view", 

"CLONE", 

"_self" 

) 

 

But for the life of me, I can't get the Button version of the URL to go back to the Product related list. I figured out that I can't reference the Opportunity Id via merge field in this scenario, so I created a formula field called Opportunity_Id__c, which just utilizes a CASESAFEID version of the Opportunity Id.  

 

In order to save time, here is a list of the various versions I've tried that DON'T work:  

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/{!OpportunityLineItem.Id

} 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/&OpportunityId&/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/OpportunityLineItem.Opportunity_Id__c/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/lightning/r/Opportunity/{!Opportunity.Id

}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/Opportunity/&OpportunityLineItem.Opportunity_Id__c&/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id}&retURL=/lightning/r/OpportunityLineItem.Id

} 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

 

/flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

OpportunityLineItem.Id

}&retURL=/lightning/r/&OpportunityLineItem.Opportunity_Id__c&/related/OpportunityLineItems/view 

 

 

Anyone have any thoughts, tips, or suggestions?  

 

#Flow  #Flows  #Screen Flow  #Formulas

7 respuestas
  1. 21 sept, 14:54

    Hi @Deepak Sachdeva

    , 

     

    Thank you for the suggestion. I tried that, exactly as you laid out, but it still did not work.  

     

    I am happy to announce, however, that I spoke with Salesforce support on Friday and they did get it to work. Confusingly, it was one of the options I had tried before, which is in the list of my original post.  

     

    This is the URL that worked:  

     

    /flow/Opportunity_Product_Screen_Flow_Clone_Opportunity_Product?recordId={!

    OpportunityLineItem.Id

    }&retURL=/lightning/r/Opportunity/{!OpportunityLineItem.Opportunity_Id__c}/related/OpportunityLineItems/view 

0/9000

I am experiencing a synchronization delay when trying to link a newly built flow to a subagent action. After creating the flow, I go to add a new action and select Flow as the Reference Action Type. However, the flow does not immediately appear in the Reference Action dropdown list and takes several minutes to become visible.

Could you please advise if this is expected caching behavior? If so, what is the standard propagation time I should expect? 

 

#Agentforce  #Flows

3 respuestas
  1. Khyati Mehta (InfinySkills) Forum Ambassador
    12 sept, 16:26

    Hello Amit, 

     

    Yes, this can happen due to backend synchronization/caching. Newly created Flows may take a few minutes before they become available in the Reference Action dropdown for a subagent. It’s not usually an issue with the Flow itself. There doesn’t seem to be a fixed guaranteed propagation time, but in practice, waiting a few minutes and refreshing/reopening the action configuration usually makes the Flow appear. Hope this helps!

0/9000

Hi everyone! 

 

I am trying to configure a new screenflow to have it's Uploaded File's name mapped into a text field.  I tried creating a Variable (Text-Collection) and added an Update Records element after the screen in an attempt to map it, but I can't get it right.   

 

What am I doing wrong here? 

 

Help with mapping attachment names into a field

 

image.png

 

image.png

 

 

 

 

 

#Flow  #Screen Flow  #Flows

12 respuestas
  1. 8 sept, 03:09

    @Mario Santellan

      

    your flow is basically right — the only broken piece is the GetFileName filter value. In that resource picker you're currently on 'Related Record ID', which is the record you attached the files to, not the uploaded file. Instead pick the Upload File component's 'Content Document IDs' output (Upload File > Content Document IDs) — that's the list of the uploaded files' Ids. Also change the operator from Equals to In, since that output is a collection: the condition should read Content Document ID In → Upload File > Content Document IDs. Equals against a collection is exactly why nothing matched. Your Title mapping is already right — Title lives on the ContentDocument record, which is why 'Content Document from GetFileName > Title' works in AddAttachmentName (Title = file name without the extension; add FileExtension if you need the .pdf/.docx part). On multiples: with 'Only the first record' selected you'll capture just the first file's name. If a partner uploads 2+ files and you want them all, switch GetFileName to 'All records', add a Loop over it, and in an Assignment append each 'Loop > Title' (plus a comma) into a Text variable, then map that variable into File Name. If one name is enough, first-record is perfect as-is. Give that a try — it should populate.

0/9000