Automation Champion

Automating Salesforce One Click at a Time
Automation Champion
  • Home
  • About Me
    • Testimonials
    • Resources
  • Process Builder
  • Salesforce Flow
  • Pardot
  • Apex
  • Training Details
    • Salesforce Administrator
    • Salesforce Advanced Administrator
    • Platform App Builder
    • Lightning Flow
    • Pardot
    • Sales Cloud
    • Service Cloud
    • Community Cloud
    • Hands-on Excercises
  • My Books
  • Contact Me
  • Tag: Delete time based action process builder

    • Getting Started with Process Builder – Part 34 (Auto Delete Posts Generated From Quick Actions)

      Posted at 3:45 PM by Rakesh Gupta, on July 10, 2015

      Big Idea or Enduring Question:

      How do you automatically delete posts generated from quick actions? 

      A few months back, I had written an article Getting Started with Process Builder – Part 17 (Auto Delete System Generated Chatter Post) to discuss a way through which, we can auto-delete system generated Chatter posts. This article goes a step ahead and explains, how to auto-delete posts generated from Quick Actions for objects in which  Feed Tracking is not enabled.  

      Objectives:

      After reading this article, the reader will be able to:

      • Using Process Builder to auto-delete system-generated chatter posts
      • How to use get the delete element to delete records 
      • How to Launch a Flow from Process Builder 

      Business Use case

      Rachel Gillett is working as a System administrator at Universal Containers (UC). At UC they have created a custom object called Time Sheet, to allow their sales reps to enter the time they spent at a customer site (i.e. against Account object). The Time Sheet object has a lookup relationship with the Account object, and Feed tracking is turned off for the Time Sheet object. Rachel has received a requirement from the management when sales reps create a Time Sheet from an account object using quick action, the system auto-generates a chatter post similar to the following screenshot:

      Post generated from Quick Action

      Business wants to auto-delete posts generated from Quick Action.

      Automation Champion Approach (I-do):

      First of all, you have to understand the Feed object in Salesforce. All objects have a default related Feed object. All Feed objects for custom objects are named as CustomObject__Feed, where CustomObject__c is the name of the related custom object. All Feed objects for standard objects are named as LeadFeed, where Lead is the related standard object name.

      But the glitch is Feed object is by default available (You can access it from the API or Flow) for a standard object, even though Feed Tracking is turned off, but that is not the case with the custom object. If Feed tracking is turned off for a custom object, then the CustomObject__Feed object will not be available. So you can’t use the CustomObject__Feed object to delete the posts (On parent object) generated from Quick Actions. 

      There are a few possible solutions for the above business scenario, but I’ll use Process Builder and Flow to solve the business requirement. 

      Before discussing it, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

      Let’s begin building this automation process.

      Guided Practice (We-do):

      There are 4 steps to solve Rachel’s business requirement using Flow and Process Builder. We must: Read the rest of this entry!

      Posted in Chatter, Process Builder, Sales cloud, Salesforce Flow | 0 Comments | Tagged Ability to delete all Chatter feed posts, AccountFeed, Add Criteria Proces builder, ADM 201, adm 201 certification, adm 201 salesforce, Advance flow, Advanced flow, Auto delete auick action posts, Auto delete posts generated from Quick Actions, Auto delete quick action post, Auto delete quick action posts, auto delete record followers, Auto Delete System Generated Chatter Post, call a flow thorugh PB, Chatter and Flow example, Chatter and Process builder example, CustomObject__Feed, Delete auto genearted post after lead conversion, Delete lead conversion Chatter post, Delete Quick action post, Delete quick action post on child object, Delete quick action post on Parent object, Delete quick action post when Feed Tracking disable, Delete quick action post when Feed Tracking disable on child, Delete system generated chatter post, Delete system generated chatter post for lead conversion, Delete system generated post, Delete system generated post on parent Account, Delete time based action process builder, Enable Process Builder, Evaluate the rule when a record is created, flow, Flow and PB examples, Flow and Prcoess Builder examples, FLow and Process builder example, flow builder in salesforce, flow builders, Flow Example, Flow examples, Flows, Getting started with Process Builder, How to activate Process builder, how to use Process builder, Hwo to delete system generated chatter post for lead conversion, Launch a Flow, Launch a Flow from Process builder, Launch flow from PB, LeadFeed, Lightning App, Lightning Flow, lightning flows in salesforce, Lightning Process builder, Map Lead Fields, New Flow, PB, Process Builder, Process Builder example, Process Builder examples, Process Builder Salesforce, Process builder use case, Record Delete, sales force automation software, salesforce Admin exam, salesforce automation, salesforce automation tools, salesforce certified developer exam, Salesforce Certified Sales Cloud Consultant, salesforce chatter, salesforce flows, salesforce lightning flow, salesforce lightning flow examples, Salesforce release exam, Spring15 process builder, Spring15 Process builder enhancement, Time bassed process builder
    • Getting Started with Process Builder – Part 17 (Auto Delete System Generated Chatter Post)

      Posted at 2:22 AM by Rakesh Gupta, on April 9, 2015

      Big Idea or Enduring Question:

      How do you delete system generated Chatter posts?

      Objectives:

      After reading this blog post, the reader will be able to:

      • Create an Auto-Launched flow to delete records
      • Launch a Flow using Process Builder to auto-delete Chatter Posts

      Business Use case

      Warren Mason is working as a System Administrator at Universal Containers (UC). When we convert the Lead, an automatic chatter post appears on the Account feed i.e., UserName converted a lead to this account, as shown in the following screenshot:

      Auto generated chatter post He wants to auto delete this post upon lead conversion.

      Automation Champion Approach (I-do):

      Salesforce Chatter is a great way to boost collaboration in your organization. A user can post statuses, links, and files and comment on other’s posts. However, many times I have found that people are looking for ways to delete system generated Chatter posts.

      In this article, I am going to discuss how to auto-delete system generated Chatter posts. There are several possible solutions. I will help you understand how to auto-delete system generated Chatter posts using Flow, and we will launch the Flow via Process Builder when the Leads gets converted.  

      Before proceeding, you have to understand the Feed table in Salesforce. All objects have a default related “Feed” object. 

      • For custom objects, all feeds are named as CustomObject__Feed, where CustomObject__c is the name of the related custom object, such as JobApplication_Feed.
      • For standard objects, all feeds are named as ObjectFeed, where Object is the name of the related standard object, such as LeadFeed. 

      Now you have to understand the below-mentioned object in Salesforce:

      • AccountFeed: – This object represents a single feed item in the feed displayed on the detail page for a Lead record.

      Before discussing it, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.

      Let’s begin building this automation process.

      Guided Practice (We-do):

      There are 5 steps to solve Warren’s business requirement using Flow and Process Builder. We must: 

      1. Create a custom checkbox field on Lead
      2. Create a custom checkbox field on Account
      3. Map custom lead fields for lead conversion 
      4. Lightning Flow Steps:
        1. Define flow properties for auto-launched flow
        2. Add a text variable to store account id
        3. Add a delete records element to delete system generated post 
      5. Process Builder Steps:
        1. Define process properties
        2. Define evaluation criteria
        3. Define process criteria
        4. Set time for actions to execute
        5. Add action – flows 

      Step 1: Creating a Checkbox Field on Lead Object

      1. Click Setup.
      2. In the Object Manager, type Lead.
      3. Select Fields & Relationships, then click New.
      4. Select Checkbox as Data Type, then click Next.
      5. Enter Field Label and click the tab key, the API Name will populate. 
      6. As a best practice, always input a description. 
      7. Default Values: Checked
      8. Set the Field-level Security for the profiles, make sure to set this field as read-only. 
      9. Do not add this field on the Page Layout.
      10. Click Save.

      Step 2: Creating a Checkbox Field on Account Object

      1. Click Setup.
      2. In the Object Manager, type Account.
      3. Select Fields & Relationships, then click New.
      4. Select Checkbox as Data Type, then click Next.
      5. Enter Field Label and click the tab key, the API Name will populate. 
      6. As a best practice, always input a description. 
      7. Default Values: Unchecked
      8. Set the Field-level Security for the profiles, make sure to set this field as read-only. 
      9. Do not add this field on the Page Layout.
      10. Click Save.

      Step 3: Map Custom Lead Fields for Lead Conversion 

      1. Click Setup.
      2. In the Object Manager, type Lead.
      3. Select Fields & Relationships, then click Map Lead Fields.
        1. You can map each of your organization’s Lead custom fields to one of your custom Account, Contact, or Opportunity fields.
      4. Map the Lead Conversion field as shown in the screenshot below.
      5. Click Save.

      Step 4.1: Lightning Flow – Define Flow Properties 

      1. Click Setup.
      2. In the Quick Find box, type Flows.
      3. Select Flows then click on the New Flow.
      4. Select the Autolaunched Flow (No Trigger) option and click on Next and configure the flow as follows: 
        1. How do you want to start building: Freeform
      5. Click Done.

      Step 4.2: Lightning Flow – Add  a Text Variable to Store Account Id

      1. Under Toolbox, select Manager, then click New Resource to pass the store Account Id.
      2. Input the following information: 
        1. Resource Type: Variable
        2. API Name: varTAccountId
        3. Data Type: Text
        4. Default Value: {!$GlobalConstant.EmptyString}
        5. Check Available for Input
        6. Check Available for Output
      3. Click Done.

      Step 4.3: Lightning Flow – Add a Delete Records Element to Delete System Generated Post

      1. Drag-and-drop Delete Records element onto the Flow designer. 
      2. Enter a name in the Label field; the API Name will auto-populate.
      3. For How to Find Records to Delete select Specify conditions.
      4. Select the Account Feed object from the dropdown list.
      5. Set Filter Conditions
        1. Row 1:
          1. Field: ParentId
          2. Operator: Equals
          3. Value: {!varTAccountId}
      6. Click Done.

      In the end, Warren’s Flow will look like the following screenshot:

      Once everything looks good, perform the steps below: 

      1. Click Save.
      2. Enter Flow Label the API Name will auto-populate.
      3. Click Show Advanced.
      4. API Version for Running the Flow: 50
      5. Interview Label: Delete system generated post {!$Flow.CurrentDateTime}
      6. Click Save. 

      Almost there! Once everything looks good, click the Activate button.  

      Our next task is to create a Process on the Account object to launch a Flow, only when an account is created from lead conversion. 

      Step 5.1: Define Process Properties

      1. Click Setup.
      2. In the Quick Find box, type Process Builder.
      3. Select Process Builder, then click New.
      4. Name the Process and click the Tab button. The API Name will populate. 
      5. As a best practice, always input a description. 
      6. The process starts when A record changes.
      7. Click Save.

      Step 5.2: Define Evaluation Criteria

      1. Click on the Add Object node to begin selecting the evaluation criteria.
      2. Select the Account object from the dropdown list.
      3. Start the process only when a record is created.
      4. Click Save.

      Step 5.3: Define Process Criteria

      1. Click the Add Criteria node to begin defining the process criteria.
      2. Name the criteria.
      3. The criteria should execute actions when the conditions are met.
      4. Set Conditions
        1. Row 1
          1. Field: Account | Lead_Conversion__c
          2. Operator: Equals
          3. Type: Boolean
          4. Value: True
      5. Select All of the conditions are met (AND). 
      6. Click Save.

      Step 5.4: set time for actions to execute

      1. Below Scheduled Actions, click Set Schedule.
      2. Set Field Values:
        1. Row 1:
          1. 0
          2. Hours
          3. After
          4. CreatedDate
      3. Click Save.

      Step 5.5: Add Action – Flows

      1. Below 0 Hours After CreatedDate Scheduled Actions, click Add Action.
      2. For Action Type, select Flows. 
      3. Name the action.
      4. Select Flow – Delete system generated post.
        1. Set Flow variables: 
          1. Row 1
            1. Field: varTAccountId
            2. Type: Field Reference
            3. Value: Account | Id
      5. Click Save.

      In the end, Warren’s Process will look like the following screenshot:

      Almost there! Once everything looks good, click the Activate button. 

      Proof of Concept

      Now onwards, if a business user converts a lead, Process Builder will automatically trigger and launch the Flow. It will then delete the system generated post after a few minutes. Let’s test it out.

      1. Below is the current status of lead Ms. Kristen Akin before conversion.
      2. After you convert the Lead, you will be directed to the Account Detail page. Click on the Account Chatter feed.
      3. Final Output
        1. Wait a few minutes and refresh the Account detail page. 
        2. Check out the Account feed. The Chatter post will be deleted.

      Formative Assessment:

      I want to hear from you!  

      What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? 

      Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.

      Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

      Posted in Chatter, Process Builder, Salesforce Flow, Spring'15 Release | 17 Comments | Tagged Ability to delete all Chatter feed posts, AccountFeed, Add Criteria Proces builder, Advanced flow, auto delete record followers, Auto Delete System Generated Chatter Post, call a flow thorugh PB, Chatter and Flow example, Chatter and Process builder example, ContactFeed, Delete auto genearted post after lead conversion, Delete lead conversion Chatter post, Delete system generated chatter post, Delete system generated chatter post for lead conversion, Delete time based action process builder, Enable Process Builder, flow, Flow and PB examples, Flow and Prcoess Builder examples, FLow and Process builder example, Getting started with Process Builder, How to activate Process builder, how to use Process builder, Hwo to delete system generated chatter post for lead conversion, Launch a Flow, Launch a Flow from Process builder, Launch flow from PB, LeadFeed, Lightning App, Lightning Process builder, Map Lead Fields, PB, Process Builder, Process Builder examples, Process Builder Salesforce, Process builder use case, Record Delete, salesforce chatter, Spring15 process builder, Spring15 Process builder enhancement, Time bassed process builder, Visual workflow
    ← Older posts
    • Search

    • Upcoming Trainings

      Salesforce Administrator Certification
      Salesforce Advanced Administrator Certification
      Salesforce Platform App Builder Certification
      Lightning Flow & Process Builder
      Advanced Lightning Flow
      Pardot Specialist & Consultant Certification
      Sales Cloud Consultant Certification
      Service Cloud Consultant Certification
      Community Cloud Consultant Certification
    • Sponsor #1

    • Sponsor #2

    • Sponsor #3

    • Sponsor #4

    • Order Now!

    • Buy My Book

    • Buy My Book

    • Recent Posts

      • Getting Started with Salesforce Flow – Part 59 (Clone a Chatter Group with Members)
      • New Research: Salesforce Delivery Teams Excel in Speed but at the Expense of Quality
      • Improve Your Data Collection Strategy with Web Forms
      • Getting Started with Salesforce Flow – Part 58 (Customize Previous, Next, Finish, and Pause Button Label for Screen Flow!)
      • Advancing Business Operations with Salesforce and QuickBooks
    • Salesforce ID Converter Build on Lightning Flow

      Converting 15 digit ID to 18 digit Salesforce ID
    • Blog Archives

    • Categories

  • Information

    • About Me
    • Affiliate Disclaimer
    • Contact Me
    • Privacy Policy
  • Top Posts

    • Learning Flow
    • Learning Process Builder
    • Getting Started with Salesforce Flow – Part 43 (Dynamic Approval Routing in Salesforce)
    • Getting Started with Salesforce Flow – Part 57 (Adding Validation to Flow Screen Components)
    • Getting Started with Salesforce Flow – Part 59 (Clone a Chatter Group with Members)
    • Getting Started with Salesforce Flow – Part 11 (Count Number of records in a Record Collection Variable)
    • Getting Started with Salesforce Flow – Part 1 (Understand, Create & Use Variables in Flow!)
    • Getting Started with Salesforce Flow – Part 24 (Automatically Assign Permission Sets to New User)
    • Salesforce Spring’21 Release Quick Summary
    • Getting Started with Process Builder - Part 1 (Automatically Create a record)
  • Social Media

    • View Automationchampion’s profile on Facebook
    • View Automationchamp’s profile on Twitter
    • View Rakeshistom’s profile on GitHub