A Flow Screen Component that plays sounds

Created by Yumi Ibrahimzade

ABOUT
This is a Lightning Component that plays a sound effect.
It can be used on Flow Screens and Lightning Pages.
In order to play a sound, you have to upload the sound file as a Static Resource and then enter the name of the file to the “Sound File” parameter.

INSTALLATION

PARAMETERS
Sound File – Enter the name of the sound file.

CONSIDERATIONS
This component loads the sound file from Static Resources and plays it. So it is recommended to use smaller file sizes, otherwise it might take some time to load the file.

HOW TO USE
1- Upload the sound file as a Static Resource.

2- Add “SoundCMP” to your Flow Screen.
3- Enter the name of the sound file to the parameter called “Sound File”.

Custom Logging in Flows

Have you ever wanted to add your own logging to your flows? I’m not talking about the system logs, but rather creating your own log entries at specific places in your flow.
I’ve had a couple of instances, where I could really use this. Both for debugging as well as simply tracing whether an auto-launched flow has executed.
After having reinvented the wheel a few times, I got tired of it and decided to create something that is more reusable, and it has proven its value already more than once.

What I’ve done is this… I’ve created a custom object, a number of flows and a few tools to manage it all. You can add this flow as a subflow to any of your own flows. This step will create a new record in the custom object on which you can report.

This Quip document contains all the details and the link to the managed package.

Flow Log Step Settings

quickChoiceFSC Now Supports Images and Icons on Visual Cards

Check out the latest update to quickChoiceFSC. Now you can display both Icons and your own Images on the Visual Cards.

Update N Records in Flow Without a Loop by Jessie Rymph

Jessie Rymph from the blog https://unhandledsunshine.com/ has published a post showcasing two new invocable actions available on this site showing how to Update N Records in Flow Without a Loop

De-dupe an sObject Collection Action and Schedule an Email in Flow

I recently posted an article over on LinkedIn on how we used an invoked action that lets you de-dupe an sobject collection and return either a text collection or a de-duped sObject collection. This can be used in so many ways, one of which is to de-dupe a collection based on OwnerId and then email that deduped set of Owner email addresses.

Check it out

Note that this will soon be added to the Collections processor package, so keep your eyes peeled there. If you have an immediate need for the functionality you’re more than welcome to use the action posted in my article.

Launch a flow from a formula field

The first post in a new series on the Salesforce admin blog demonstrates a novel way to launch auoto-launched flows from a formula field on a report. This has several very interesting use cases
Check it out

Tie it All Together with this Quick App Switcher

Check out my Blog Post and take a look at the Source Code to see how I used Lightning Web Components, a Lightning Aura Component, Apex, Custom Metadata Types, a Static Resource and a Flow to create a Smart and Fast Custom App Switcher that can be used both on Record Pages and on Utility Bars.

Jodie Miners turns her gaze to Before-Save Flows

She should send an invoice to Salesforce for providing analysis of this depth & quality. Check it out.

Clone Records (and modify them before Insert) Declaratively with Spring ’20

I recently wrote an article outlining my discoveries around the new ‘Get All Fields’ feature of Gets in Spring ’20.

Check it out

A Graphical SOQL Query Builder for Flow, plus an Execute SOQL Action

You can create an Action that executes any SOQL query it gets passed.

The video below has a good introduction, but also check out this excellent demonstration of Execute SOQL being used with subqueries and merge fields and without a graphical front end.

In this instance, an ExecuteSOQL action has been configured to take a SOQL string as an input and return a collection of Accounts:

This milestone means it’s now worthwhile to build a Flow Screen component that can be used to generate SOQL queries:

The SOQLBuilder LWC can take an existing SOQL string and will try to parse it and display it in the UI. It will output a string based on whatever is generated in the builder.

Note that when configuring the Execute SOQL Action, it’s necessary to specify the object type that will be returned. Make sure that the Object Type specified in the SOQLBuilder matches. In other words, if you have an Execute SOQL action in your flow that’s hard configured to return Contact records, don’t pass it a string that queries on Accounts.

Inserting Dynamic Mergefields into your SOQL Queries

You can make a dynamic date part of your SOQL query, taking the date from upstream in your Flow. Just insert standard mergefield syntax: myquery='[SELECT Account.Name FROM Contact WHERE startdate__c > {!myUpstreamFlowDate}]’ . Important: Note that you do not delimit the mergefield with an additional set of quote marks.

Using Date Literals and Ids

Query on Id string literal:
SELECT LastName from Contact WHERE Id = '1123xxx333e3e'

Query on date literal:
SELECT Id from Contact WHERE CreatedDate = LAST_n_DAYS:14

Handles nested relationship queries in the WHERE clause

The action will first check to see if at least one of those queries exists and if true, will recursively search the nested queries and do the same formatted on those; If false, it will continue on with the single query search.

SELECT Id, Name,Status_DD__c,Region__c FROM Object2__c WHERE Status_DD__c in (‘Option 1′,’Option 2′,’Option 3’) and id not in (SELECT Id FROM Object1__c WHERE CreatedDate >= 2020-04-12T15:24:00Z) and Field1__r.Custom__c = ‘1234’

SELECT Id, Status__c, Contact__c , Custom__c FROM Object_1__c WHERE Status__c like ‘%Active%’ AND Account__r.Custom__c = ‘1234’ AND Custom__c not in (select Custom__c from Object_2__c where Contact__c = ‘1234’)

Secondary Fixes

  • Strip unwanted formatting characters from the query string that come in when text template is used in flow: ‘\n’, ‘\r\n’, ‘\t’
  • Fix time stamp formatting on date strings with a time: ’00:00 am’ is an invalid format. The equivalent, valid format using regular time is ’12:00 am’. ’00:00′ is only valid for 24hr formatting.
  • Fix month name to month number conversion: prepend a 0 on the month number if the string value is < 10

Improvements

  • Throw some exceptions for more informative error handling
  • Cleaned up unit suite and fixed failing tests

Potential issues not yet fixed:

It appears that after the ‘ order by ‘ substring is removed from the query, it is never added back before querying.

Use Cases:

New Features in V1.2

You can make a dynamic date part of your SOQL query, taking the date from upstream in your Flow. Just insert standard mergefield syntax: myquery='[SELECT Account.Name FROM Contact WHERE startdate__c > {!myUpstreamFlowDate}’

Works properly with Schedule Triggers

New Features in V1.1

  • You can now traverse to select related fields via relationships (example: [SELECTAccount.Name FROMContact...]
    • SELECT Id, Name,Status_DD__c,Region__c FROM Object2__c WHERE Status_DD__c in (‘Option 1′,’Option 2′,’Option 3’) and id not in (SELECT Id FROM Object1__c WHERE CreatedDate >= 2020-04-12T15:24:00Z) and Field1__r.Custom__c = ‘1234’
    • SELECT Id, Status__c, Contact__c , Custom__c FROM Object_1__c WHERE Status__c like ‘%Active%’ AND Account__r.Custom__c = ‘1234’ AND Custom__c not in (select Custom__c from Object_2__c where Contact__c = ‘1234’)
  • An ‘Add All’ button lets you easily create the equivalent of a Select *
  • You can lock down the object that the query is returning by setting the attribute disableObjectTypeSelection to True. This is useful when you’re pairing this component with an Execute SOQL action, because the action has to be locked to a specific action type in the Flow Builder, and this avoids the user selecting a different action and ending up with a mismatch.

V1.3.6 12-21 Update on Date Locales:

There were 2 problems:

  1. Datetime.parse() can only parse dates in the locale of the user, the unit test just assumed it will be en_US and failed for everyone else. (our default is de_DE for example, dates look completely different)
  2. Salesforce is about to enable this critical update for everyone on January 31st: https://help.salesforce.com/s/articleView?id=release-notes.rn_forcecom_globalization_enable_icu_cruc.htm&type=5&release=224

Before this update Datetime.parse() could parse en_US dates without a comma (04/12/2020 03:24 PM) just fine, but not with a comma (04/12/2020, 03:24 PM)

After the update it is the other way around.

The changes introduced with #974 made it work in orgs without the update enabled, but broke it for orgs with the update.
The scratchOrg that is used by the force:package:version:create command has it enabled by default, therefore the command fails.

In order to support both formats, i’ve added a regex to parse en_US dates regardless of the comma.
Also the monthDayCommaYear format is now parsed with a regex.

Datetime.parse() is kept as fallback for people using their locale formats.
But If they have a multilingual org with users having different locales, it will still not work for them.Using locale formats is not recommended and users should stick to ISO dates.

Installation

V1.3.8 1-12-23 Production Sandbox Adds an onchange handler

Troubleshooting

View Source

Source

Old Versions

V1.3.7 Unlocked 8/14/22

V1.3.6 Unlocked 12-17-21

V1.3.5 Unlocked 1-20-21 Update to work with base packs

V1.3.4 Unlocked 9-6-20 Bug Fix

Unmanaged V 1.3.3 6/27/20 Bug fixes and hardening.

  1. Fixed bulkification bug – moved location of String soqlQuery = curRequest.soqlQuery;
  2. getFormattedValue – adding missing comma in fieldValue += ', 12:00 am';
  3. Increased testing to 100% code coverage
  4. Renamed invocable method to execute from getEligibleProducts and added getEligibleProducts to support any legacy users.

Unmanaged V 1.3.2 5/5/20

Unmanaged V 1.3.1 4/30/20

Unmanaged V 1.2

Unmanaged V 1.1

Unmanaged Packages V 1.0