Snippets Collections
TEXT(MONTH(DATEVALUE({!f_StartDateTimeWithTimeZoneOffset}))) & "/" &
TEXT(DAY(DATEVALUE({!f_StartDateTimeWithTimeZoneOffset}))) & "/" &
TEXT(YEAR(DATEVALUE({!f_StartDateTimeWithTimeZoneOffset}))) & " " &
IF(
    VALUE(MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 12, 2)) = 0, 
    "12:" & 
    RIGHT("00" & MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 15, 2), 2) & 
    " AM", 
    IF(
        VALUE(MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 12, 2)) < 12,
        TEXT(VALUE(MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 12, 2))) & ":" & 
        RIGHT("00" & MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 15, 2), 2) & 
        " AM",
        IF(
            VALUE(MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 12, 2)) = 12,
            "12:" & 
            RIGHT("00" & MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 15, 2), 2) & 
            " PM",
            TEXT(VALUE(MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 12, 2)) - 12) & ":" & 
            RIGHT("00" & MID(TEXT({!f_StartDateTimeWithTimeZoneOffset}), 15, 2), 2) & 
            " PM"
        )
    )
)
//f_GMTOffset
24 * (DATETIMEVALUE({!$Flow.CurrentDate}) - {!Convert_Today_To_DateTime.datetimeValue})

//Convert_Today_To_DateTime is an UnofficialSF Action - ConvertDateToDatetimeFlowAction

{!dateTimeVariable} + ({!f_GMTOffset}/24)

LEFT($Api.Enterprise_Server_URL_610, FIND( '/services', $Api.Enterprise_Server_URL_610))
SELECT Id, Name, LastViewedDate, LastRunDate FROM Report WHERE Id = '00O2400000XXXXX' ORDER BY LastViewedDate ASC
1. Create Quick Action to open the Screen Flow on the Parent object (Example - Opportunity)
2. Create List Button on the child object to reference that Quick Action.

Quick Action Developer Name: Add_Products_Related_List

List button syntax:
/lightning/action/quick/SOBJECT.QUICK_ACTION_DEV_NAME?objectApiName&context=RECORD_DETAIL&recordId={!CASESAFEID(OBJECT.Id)}&backgroundContext=%2Flightning%2Fr%2FOpportunity%2F{!CASESAFEID(OBJECT.Id)}%2Fview

Example:

/lightning/action/quick/Opportunity.Add_Products_Related_List?objectApiName&context=RECORD_DETAIL&recordId={!CASESAFEID(Opportunity.Id)}&backgroundContext=%2Flightning%2Fr%2FOpportunity%2F{!CASESAFEID(Opportunity.Id)}%2Fview
IF(
  CONTAINS({!$Flow.FaultMessage}, "REQUIRED_FIELD_MISSING"),
  MID(
    {!$Flow.FaultMessage},
    FIND("REQUIRED_FIELD_MISSING: ", {!$Flow.FaultMessage}) + LEN("REQUIRED_FIELD_MISSING: "),
    FIND(". You can look up ExceptionCode values in the", {!$Flow.FaultMessage}) - FIND("REQUIRED_FIELD_MISSING: ", {!$Flow.FaultMessage}) - LEN("REQUIRED_FIELD_MISSING: ")
  ),
  IF(
    CONTAINS({!$Flow.FaultMessage}, "FIELD_CUSTOM_VALIDATION_EXCEPTION"),
    MID(
      {!$Flow.FaultMessage},
      FIND("FIELD_CUSTOM_VALIDATION_EXCEPTION: ", {!$Flow.FaultMessage}) + LEN("FIELD_CUSTOM_VALIDATION_EXCEPTION: "),
      FIND(". You can look up ExceptionCode values in the", {!$Flow.FaultMessage}) - FIND("FIELD_CUSTOM_VALIDATION_EXCEPTION: ", {!$Flow.FaultMessage}) - LEN("FIELD_CUSTOM_VALIDATION_EXCEPTION: ")
    ),
    IF(
      CONTAINS({!$Flow.FaultMessage}, "_EXCEPTION"),
      MID(
        {!$Flow.FaultMessage},
        FIND("_EXCEPTION: ", {!$Flow.FaultMessage}) + LEN("_EXCEPTION: "),
        FIND(". You can look up ExceptionCode values in the", {!$Flow.FaultMessage}) - FIND("_EXCEPTION: ", {!$Flow.FaultMessage}) - LEN("_EXCEPTION: ")
      ),
      {!$Flow.FaultMessage}
    )
  )
)



/*

For "REQUIRED_FIELD_MISSING" error:

MID({!$Flow.FaultMessage}, FIND('REQUIRED_FIELD_MISSING: ', {!$Flow.FaultMessage}) + LEN('REQUIRED_FIELD_MISSING: '), FIND('. You can look up ExceptionCode values in the', {!$Flow.FaultMessage}) - FIND('REQUIRED_FIELD_MISSING: ', {!$Flow.FaultMessage}) - LEN('REQUIRED_FIELD_MISSING: '))


For "_EXCEPTION" endigns (i.e, "FIELD_CUSTOM_VALIDATION_EXCEPTION"):

MID({!$Flow.FaultMessage}, FIND('_EXCEPTION: ', {!$Flow.FaultMessage}) + LEN('_EXCEPTION: '), FIND('. You can look up ExceptionCode values in the', {!$Flow.FaultMessage}) - FIND('_EXCEPTION: ', {!$Flow.FaultMessage}) - LEN('_EXCEPTION: '))

// Note there are many other exceptions that don't fall into these 2 types. Check the developer guide and make sure the full error is displayed of not found.

// The "SOAP API Developer Guide" is a hyperlink - that's why it's not part of the formula


*/
star

Sun Apr 13 2025 23:00:56 GMT+0000 (Coordinated Universal Time)

#salesforce #screnflow #formula
star

Sun Apr 13 2025 22:59:22 GMT+0000 (Coordinated Universal Time)

#salesforce #screnflow #formula
star

Tue Mar 18 2025 23:56:58 GMT+0000 (Coordinated Universal Time)

#salesforce #screnflow #relatedlist
star

Sat Feb 01 2025 20:53:34 GMT+0000 (Coordinated Universal Time) https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8mBfSAJ

#salesforce #screnflow #relatedlist
star

Wed Jan 29 2025 16:27:00 GMT+0000 (Coordinated Universal Time) https://hugolemos.medium.com/launch-flow-modal-from-a-related-list-00aba6590187

#salesforce #screnflow #relatedlist
star

Thu Jan 16 2025 04:06:41 GMT+0000 (Coordinated Universal Time) https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#

#salesforce #screnflow #formulas

Save snippets that work with our extensions

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