Sunday, September 24, 2023
HomeUncategorizedSet Your Productiveness on Steroids by Creating Subflows

Set Your Productiveness on Steroids by Creating Subflows

[ad_1]

Final Up to date on August 11, 2022 by Rakesh Gupta

Salesforce Stream is without doubt one of the most used declarative instruments to automate enterprise processes in Salesforce. Most of us often create a brand new stream for every requirement. That not solely just isn’t a greatest follow, however, in the long term, it’s a extremely unproductive and unsustainable strategy to managing course of improvement.

Moreover, you threat hitting the governor restrict for those who create a number of flows on one object. Subsequently, my suggestion is to create as minimal as doable flows on every object. 

With the latest launch, it’s doable to invoke an autolaunched stream (as subflow) from an After-Save record-triggered stream. With Subflow, you may reuse logic in flows. Construct one autolaunched stream (subflow); name it from a number of flows or a number of motion teams in the identical stream. By utilizing this methodology – of reusing a stream – it can save you time, hold the governor’s restrict at arm’s size and enhance your productiveness! 

Pamela Kline is working as a System Administrator at Gurukul on Cloud (GoC). She should replace the Account customized discipline, Out of Enterprise, to True if an Alternative Stage is up to date to Closed Misplaced. 

There are numerous methods, as listed, in which you’ll be able to remedy the previous enterprise requirement:

  • With one record-triggered stream on the chance object 
  • Apex Set off
  • and rather more

As of now, the very first answer seems good. After just a few weeks, nevertheless, Pamela obtained one other related requirement – to replace the Account customized discipline, Out of Enterprise, to True if Account Ranking is Not . Oh, no! Not once more!

Now she has to re-write the identical logic by making a File-Triggered stream on Account object; that is tedious and time-consuming, to say the least. As a result of, as you may see, in each the necessities, we’re updating Account customized discipline, Out of Enterprise, to True. How about reusing the prevailing logic with Account Stream? Allow us to do it!

Automation Champion Strategy (I-do):

There are just a few doable options for the above enterprise situationTo unravel the previous enterprise requirement (Replace Account customized discipline, Out of Enterprise, to True if an Alternative is up to date to Closed Misplaced), we are going to use the idea of subflow.

Subflow means launch one other stream that’s accessible in your org. A stream that’s launched by one other stream is known as the referenced stream.

We’ve got to create two flows for this, as follows:

  • The primary autolaunched stream (It’s invoked by record-triggered stream) it’s used to replace account discipline.
  • One other stream (A record-triggered stream) is positioned on the Alternative object, and it’ll fireplace solely when an Alternative Stage is up to date to Closed Misplaced

The advantage of utilizing this strategy is that for those who get a requirement sooner or later – to replace the Account customized discipline, Out of Enterprise, to True if Account Ranking is Not – then, you name the autolaunched stream out of your Account record-triggered stream with out including one other File Replace on Account stream.

Guided Observe (We-do):

  1. To start with, create a customized discipline (Out_of_Business__c) knowledge sort Checkbox, on account object.
  2. Make certain so as to add worth Not for Ranking (drop-down) discipline on the account.

Step 3: Outline Subflow Properties

  1. Click on Setup.
  2. Within the Fast Discover field, sort Flows.
  3. Choose Flows, then click on on the New Stream.
  4. Choose the Autolaunched Stream (No Set off) choice.
  5. Click on on Create.

Step 4: Add Motion – Replace Data

The subsequent step is to replace the account Out of Enterprise discipline to True. We’ll use the Replace Data ingredient. 

  1. On Stream Designer, click on on the +icon and choose the Replace Data ingredient.
  2. Enter a reputation within the Label discipline; the API Identify will auto-populate.
  3. For The way to Discover Data to Replace and Set Their Values choose Specify situations to determine data, and set fields individually
  4. Object: Account
  5. Choose All Situations Are Met (AND)
  6. Set Filter Situations
    1. Row 1:
      1. Area: Id
      2. Operator: Equals
      3. Worth: {!varT_AccountId}
        1. The place varT_AccountId is a textual content variable of sort Enter and Output.
  7. Set Area Values for the Alternative Data
    1. Row 1:
      1. Area: Out_of_Business__c
      2. Worth: {!$GlobalConstant.True}
  8. Click on Carried out.

In the long run, Pamela’s Subflow Stream will appear like the next screenshot:

As soon as all the things seems good, carry out the steps under:

  1. Click on Save.
  2. Enter Stream Label the API Identify will auto-populate.
  3. Click on Present Superior.
  4. API Model for Working the Stream: 56
  5. Interview Label: Subflow: Account Replace
  6. Click on Save.

Virtually there! As soon as all the things seems good, click on the Activate button.  

Step 5: Outline a Grasp File-Triggered Stream to Name a Subflow

  1. Click on Setup.
  2. Within the Fast Discover field, sort Flows.
  3. Choose Flows, then click on on the New Stream.
  4. Choose the File-Triggered Stream choice, click on on Create 
    1. Object: Alternative
    2. Set off Alternative Stream When: A file is created or up to date
    3. Set Entry Standards
      1. Situation Necessities: None
    4. Optimize the Stream For Motion and Associated Data
  5. Click on Carried out.

Step 6: Utilizing Resolution Aspect to Examine if Alternative is Closed Misplaced or Not

Now we are going to use the Resolution ingredient to verify the StageName to make sure that it is the same as Closed Misplaced. 

Virtually there! As soon as all the things seems good, click on the Activate button.  

Proof of Idea

Subsequent time, when a consumer updates the chance Stage to Closed Misplaced, each the Flows will fireplace and replace the Account Out_of_business__C to True, as proven within the following screenshot:

Formative Evaluation:

I need to hear from you!

What’s one factor you realized from this put up? How do you envision making use of this new information in the actual world? Be happy to share within the feedback under.

[ad_2]

Source link

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments