Snippets Collections
{!$CustomMetadata.APINameoftheCMDT__mdt.APINameoftheSpecificCMDT.APINameoftheField}

Example:
{!$CustomMetadata.Generic_Configuration__mdt.Cancelled_Event_Owner.Value__c}
SELECT Id, Name, Owner.Name, OwnerId, CreatedBy.Name 
FROM Report 
USING SCOPE allPrivate 
WHERE Name = 'missing report' and FolderName = 'Private Reports'
SUBSTITUTE({!EmailBody}, "<p>", "<p style='margin-top:0px; margin-bottom:0px;'>")
//Increase the Modal Height

.uiModal flowruntime-flow {
    max-height: 100% !important;
}
 
//Set the Modal Width

.uiModal--medium .modal-container {
    max-width: 400px !important;
}
 

//Hide the Close Button

button.slds-modal__close.closeIcon {
    display: none;
}
 
//Increase the Text Area Fields' Height

textarea {
    min-height: 300px !important;
}
 

//
//Change the Color of Text Area Fields

textarea {
    color: green !important;
    font-weight: 800;
    min-height: 200px !important;
}

//Change the Navigation Bar's Color

.uiModal flowruntime-navigation-bar {
    background-color: lightblue !important;
    border-width: 0 !important;
}

//Add a Background Image

.uiModal flowruntime-flow {
    background-image: url("https://salesforcetime.com/wp-content/uploads/2021/04/sfba3.jpg") !important;
    background-repeat: no-repeat !important;
    background-position: center;
    background-size: cover;
}

.slds-modal__header {
    margin-bottom: 0 !important;
}

//Remove the Borders of the Flow

article.flowRuntimeForFlexipage {
 border: none;
}

//Change the Height of a Data Table

flowruntime-datatable .restrict-scroll {
    max-height: 200px !important;
}
{!$CustomMetadata.APINameoftheCMDT.APINameoftheSpecificCMDT.APINameoftheField}
SELECT Id, ContentDocumentId, LinkedEntityId, ShareType, Visibility 
FROM ContentDocumentLink 
WHERE ContentDocumentId IN (SELECT Id FROM ContentDocument)
SELECT Id,Name,InterviewLabel, InterviewStatus,CreatedDate FROM FlowInterview WHERE InterviewStatus = 'Error'
Sucess Banner:
<div class="slds-box slds-box_small slds-theme_success">
  
Failure Banner:
<div class="slds-box slds-box_small slds-theme_error">

Warning Banner:
<div class="slds-box slds-box_small slds-theme_warning">

Information Banner:
<div class="slds-box slds-box_small slds-theme_shade">

Success Notification 
<div class="slds-scoped-notification slds-theme_success" role="status">

Failure  Notification
<div class="slds-scoped-notification slds-theme_error" role="status">
  
Warning Notification 
<div class="slds-scoped-notification slds-theme_warning" role="status">

Flow version:
HYPERLINK(LEFT($Api.Enterprise_Server_URL_610, FIND( '/services', $Api.Enterprise_Server_URL_610)) & {!$Record.AccountId}, {!$Record.Account.Name})     
     
Forula version: 
HYPERLINK(LEFT($Api.Enterprise_Server_URL_610, FIND( '/services', $Api.Enterprise_Server_URL_610)) & AccountId, Account.Name)     
global with sharing class BK_FilterCollectionByField {
    global class FilterException extends Exception {}
    @InvocableMethod(label='Filter Collection By Field')
    global static List<Result> filterRecordsByField(List<Request> requests) {
        List<Result> results = new List<Result>();
        for(Request request : requests) {
            // Validate inputs
            if (request.allowEmptyCollection != true && (request.inputRecords == null || request.inputRecords.isEmpty())) {
                throw new FilterException('Input record collection is required but empty.');
            }
            if (request.filterValues == null || request.filterValues.isEmpty()) {
                throw new FilterException('Filter values are required but empty.');
            }
            if (String.isBlank(request.fieldAPIName)) {
                throw new FilterException('Field to filter by is required but empty.');
            }
            List<SObject> filteredRecords = new List<SObject>();
            if (request.allowEmptyCollection == true && (request.inputRecords == null || request.inputRecords.isEmpty())) {
                // Return empty result if allowed
                filteredRecords = new List<SObject>{};
            } else {
                // Prepare the set or list for filter values based on case sensitivity
                Set<String> filterValuesSet = new Set<String>();
                if(request.caseSensitive == true) {
                    filterValuesSet.addAll(request.filterValues);
                } else {
                    for(String value : request.filterValues) {
                        if(value != null) {
                            filterValuesSet.add(value.toLowerCase());
                        }
                    }
                }
                // Filter records
                for(SObject record : request.inputRecords) {
                    Object fieldValueObj = record.get(request.fieldAPIName);
                    if(fieldValueObj != null) {
                        String fieldValue = String.valueOf(fieldValueObj);
                        if(request.caseSensitive == true) {
                            if(filterValuesSet.contains(fieldValue)) {
                                filteredRecords.add(record);
                            }
                        } else {
                            if(filterValuesSet.contains(fieldValue.toLowerCase())) {
                                filteredRecords.add(record);
                            }
                        }
                    }
                }
            }
            Result result = new Result();
            result.filteredRecords = filteredRecords;
            results.add(result);
        }
        return results;
    }
    global class Request {
        @InvocableVariable(label='Input Records' description='Collection of records to filter' required=true)
        global List<SObject> inputRecords;
        @InvocableVariable(label='Filter Values' description='Collection of string values to filter by' required=true)
        global List<String> filterValues;
        @InvocableVariable(label='Field API Name' description='API name of the field to filter by' required=true)
        global String fieldAPIName;
        @InvocableVariable(label='Allow Empty Collection' description='Allow the input record collection to be empty? Default is false')
        global Boolean allowEmptyCollection = false;
        @InvocableVariable(label='Case Sensitive' description='Perform case-sensitive matching? Default is false')
        global Boolean caseSensitive = false;
    }
    global class Result {
        @InvocableVariable(label='Filtered Records' description='Collection of records that match the filter criteria')
        global List<SObject> filteredRecords;
    }
}





Test class:
@isTest
private class BK_FilterCollectionByFieldTest {
    @isTest
    static void testFilterRecordsByField() {
        // Create sample accounts
        Account acc1 = new Account(Name = 'Test Account 1', AccountNumber = '123');
        Account acc2 = new Account(Name = 'Test Account 2', AccountNumber = '456');
        Account acc3 = new Account(Name = 'Test Account 3', AccountNumber = '789');
        insert new List<Account>{acc1, acc2, acc3};
        // Prepare request
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>{acc1, acc2, acc3};
        request.filterValues = new List<String>{'123', '789'};
        request.fieldAPIName = 'AccountNumber';
        request.caseSensitive = true;
        // Call the method
        List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
            new List<BK_FilterCollectionByField.Request>{request}
        );
        // Assert the results
        System.assertEquals(1, results.size(), 'Should return one result object');
        System.assertEquals(2, results[0].filteredRecords.size(), 'Should return two filtered records');
        Set<Id> expectedIds = new Set<Id>{acc1.Id, acc3.Id};
        Set<Id> resultIds = new Set<Id>();
        for(SObject sobj : results[0].filteredRecords) {
            resultIds.add(sobj.Id);
        }
        System.assertEquals(expectedIds, resultIds, 'Filtered records should match expected accounts');
    }
    @isTest
    static void testFilterRecordsByField_CaseInsensitive() {
        // Create sample accounts with varying case in AccountNumber
        Account acc1 = new Account(Name = 'Test Account 1', AccountNumber = 'abc');
        Account acc2 = new Account(Name = 'Test Account 2', AccountNumber = 'DEF');
        Account acc3 = new Account(Name = 'Test Account 3', AccountNumber = 'GHI');
        insert new List<Account>{acc1, acc2, acc3};
        // Prepare request
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>{acc1, acc2, acc3};
        request.filterValues = new List<String>{'Abc', 'def'};
        request.fieldAPIName = 'AccountNumber';
        request.caseSensitive = false;
        // Call the method
        List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
            new List<BK_FilterCollectionByField.Request>{request}
        );
        // Assert the results
        System.assertEquals(1, results.size(), 'Should return one result object');
        System.assertEquals(2, results[0].filteredRecords.size(), 'Should return two filtered records');
        Set<Id> expectedIds = new Set<Id>{acc1.Id, acc2.Id};
        Set<Id> resultIds = new Set<Id>();
        for(SObject sobj : results[0].filteredRecords) {
            resultIds.add(sobj.Id);
        }
        System.assertEquals(expectedIds, resultIds, 'Filtered records should match expected accounts');
    }
    @isTest
    static void testFilterRecordsByField_EmptyCollectionAllowed() {
        // Prepare request with empty inputRecords
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>();
        request.filterValues = new List<String>{'123', '789'};
        request.fieldAPIName = 'AccountNumber';
        request.allowEmptyCollection = true;
        // Call the method
        List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
            new List<BK_FilterCollectionByField.Request>{request}
        );
        // Assert the results
        System.assertEquals(1, results.size(), 'Should return one result object');
        System.assertEquals(0, results[0].filteredRecords.size(), 'Should return zero filtered records');
    }
    @isTest
    static void testFilterRecordsByField_ExceptionOnEmptyCollection() {
        // Prepare request with empty inputRecords
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>();
        request.filterValues = new List<String>{'123', '789'};
        request.fieldAPIName = 'AccountNumber';
        request.allowEmptyCollection = false;
        // Call the method and expect exception
        try {
            List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
                new List<BK_FilterCollectionByField.Request>{request}
            );
            System.assert(false, 'Expected an exception due to empty inputRecords');
        } catch (Exception ex) {
            System.assert(ex instanceof BK_FilterCollectionByField.FilterException, 'Expected a FilterException');
            System.assertEquals('Input record collection is required but empty.', ex.getMessage());
        }
    }
    @isTest
    static void testFilterRecordsByField_ExceptionOnEmptyFilterValues() {
        // Create sample accounts
        Account acc1 = new Account(Name = 'Test Account 1', AccountNumber = '123');
        insert acc1;
        // Prepare request with empty filterValues
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>{acc1};
        request.filterValues = new List<String>();
        request.fieldAPIName = 'AccountNumber';
        // Call the method and expect exception
        try {
            List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
                new List<BK_FilterCollectionByField.Request>{request}
            );
            System.assert(false, 'Expected an exception due to empty filterValues');
        } catch (Exception ex) {
            System.assert(ex instanceof BK_FilterCollectionByField.FilterException, 'Expected a FilterException');
            System.assertEquals('Filter values are required but empty.', ex.getMessage());
        }
    }
    @isTest
    static void testFilterRecordsByField_ExceptionOnEmptyFieldAPIName() {
        // Create sample accounts
        Account acc1 = new Account(Name = 'Test Account 1', AccountNumber = '123');
        insert acc1;
        // Prepare request with empty fieldAPIName
        BK_FilterCollectionByField.Request request = new BK_FilterCollectionByField.Request();
        request.inputRecords = new List<SObject>{acc1};
        request.filterValues = new List<String>{'123'};
        request.fieldAPIName = '';
        // Call the method and expect exception
        try {
            List<BK_FilterCollectionByField.Result> results = BK_FilterCollectionByField.filterRecordsByField(
                new List<BK_FilterCollectionByField.Request>{request}
            );
            System.assert(false, 'Expected an exception due to empty fieldAPIName');
        } catch (Exception ex) {
            System.assert(ex instanceof BK_FilterCollectionByField.FilterException, 'Expected a FilterException');
            System.assertEquals('Field to filter by is required but empty.', ex.getMessage());
        }
    }
}
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lightningSharingWrapper">
    <apiVersion>46.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>SubmitterWrapperLWC</masterLabel>
    <description>This is a demo component.</description>

    <targets>
        <target>lightning__FlowScreen</target>  
        <target>lightning__RecordPage</target> 
    </targets>

    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen" category="some random category">
            <property name="ruleName" type="String" role="inputOnly" />
            <property name="recordId" type="String" role="inputOnly" />
        </targetConfig>
        <targetConfig targets="lightning__RecordPage">     
            <objects>
                <object>Account</object> 
            </objects>
        </targetConfig>
    </targetConfigs>

</LightningComponentBundle>
YouTubeDropperButton.Run(varSplitText, (If(IsBlank(Notes.HtmlText), "", Notes.HtmlText)))
  override func viewDidLoad() {
        super.viewDidLoad()
    
           let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
            let width = UIScreen.main.bounds.width
            layout.sectionInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
            layout.itemSize = CGSize(width: width / 2 - 20, height: width / 2)
            layout.minimumInteritemSpacing = 0
            layout.minimumLineSpacing = 0
            popularServicesCollectionView!.collectionViewLayout = layout
  }

```flow
st=>start: 开始框
op=>operation: 处理框
cond=>condition: 判断框(是或否?)
sub1=>subroutine: 子流程
io=>inputoutput: 输入输出框
e=>end: 结束框
st(right)->op(right)->cond
cond(yes)->io(bottom)->e
cond(no)->sub1(right)->op
```
```flow
st=>start: 开始框
op=>operation: 处理框
cond=>condition: 判断框(是或否?)
sub1=>subroutine: 子流程
io=>inputoutput: 输入输出框
e=>end: 结束框
st->op->cond
cond(yes)->io->e
cond(no)->sub1(right)->op
```
star

Fri Dec 20 2024 00:10:45 GMT+0000 (Coordinated Universal Time) https://salesforcetime.com/2024/04/06/using-custom-metadata-types-in-flow-without-get/

#salesforce #custommetadatatype #flow #cmdt
star

Tue Dec 17 2024 00:58:05 GMT+0000 (Coordinated Universal Time) https://www.linkedin.com/posts/steven-trumble_discovered-a-new-useful-soql-keyword-today-activity-7198366400841678848-AVur/

#flow #salesforce #email
star

Mon Dec 09 2024 22:31:09 GMT+0000 (Coordinated Universal Time) https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007PycvnSAB

#flow #salesforce #email
star

Sat Dec 07 2024 21:20:19 GMT+0000 (Coordinated Universal Time) https://salesforcetime.com/2023/11/15/how-to-control-the-css-of-screen-flows/

#flow #salesforce #ui
star

Thu Nov 21 2024 19:48:17 GMT+0000 (Coordinated Universal Time) https://salesforcetime.com/2024/04/06/using-custom-metadata-types-in-flow-without-get/

#flow #salesforce #cmdt
star

Tue Oct 15 2024 23:18:06 GMT+0000 (Coordinated Universal Time) https://www.linkedin.com/posts/davidmasri_%F0%9D%90%8D%F0%9D%90%9E%F0%9D%90%B0-%F0%9D%90%AC%F0%9D%90%AE%F0%9D%90%A9%F0%9D%90%9E%F0%9D%90%AB-%F0%9D%90%A1%F0%9D%90%9A%F0%9D%90%9C%F0%9D%90%A4-%F0%9D%90%9F%F0%9D%90%A8%F0%9D%90%AE%F0%9D%90%A7%F0%9D%90%9D-ever-activity-7251940478143664129-YeU9?utm_source=share&utm_medium=member_desktop

#flow #salesforce #slds
star

Tue Oct 15 2024 21:23:25 GMT+0000 (Coordinated Universal Time) https://salesforce.stackexchange.com/questions/337563/cant-delete-flow-version-because-its-referenced-by-deleted-flow-interviews

#flow #salesforce #slds
star

Fri Sep 20 2024 21:28:30 GMT+0000 (Coordinated Universal Time) https://unofficialsf.com/build-lightning-styled-screen-flows-that-users-will-love/

#flow #salesforce #slds
star

Wed Sep 18 2024 20:48:41 GMT+0000 (Coordinated Universal Time)

#apex #flow #salesforce #formula
star

Wed Sep 18 2024 14:21:44 GMT+0000 (Coordinated Universal Time)

#apex #flow #salesforce
star

Sat Oct 29 2022 13:00:00 GMT+0000 (Coordinated Universal Time) https://unofficialsf.com/adding-lightning-web-components-to-flow-screens/

#lwc #flow
star

Mon May 23 2022 05:09:17 GMT+0000 (Coordinated Universal Time)

#ios #swift #collectionview #collection #flow #flowlayout
star

Mon Apr 26 2021 09:30:51 GMT+0000 (Coordinated Universal Time)

#markdown #flow
star

Mon Apr 26 2021 09:29:56 GMT+0000 (Coordinated Universal Time)

#markdown #flow

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension