Title
Organization Wide/Selective Processing
Published Body

When Organization-Wide is enabled, Case Flags will work with all Cases in the organization. If Case Flags is only to be used for specific cases (by origin, type, record type, etc.) you can disable Organization-Wide and enable Cases based on criteria using Flow or other automation.

image.png

  • Configure Selective Processing: Disable the Organization-Wide setting within the General Setup section of the setup wizard by unchecking the box.
  • Set up a Flow or Apex trigger to set the "Enable Case Flags" checkbox field to True based on specified criteria for only those Cases that should be processed. You will also need to include a second field update to set the Case Flag Date/Time field to "NOW()" to actually Set the Flag on Case Creation. 

Note: The second Flow action is needed because the Case Flags trigger that typically sets the flag on case creation runs before the Enable Case Flags field update so it is unable to set the flag. 

Example: if you want to enable Case Flags for all Cases where Type = Trial, you could do so by creating a Flow with an Update Records Element.

To start, go to Setup | Flows | New Flow.

  • Select Record-Triggered Flow and click on the Create button
  • Select Object = Case
  • Configure Trigger = A record is created or updated
  • Set Entry Conditions = All Conditions are Met (AND); Field = Type and set the specific Case Types that should be used for selective processing in Case Flags
  • When to Run the Flow for Updated Records = Only when the record is updated to meet the condition requirements
  • Optimize the Flow for = Actions and Related Records
  • Click Done

2022-11-29_16-26-03.png

 

Create a new Formula for the Case Flags Date/Time field to be set to NOW:

  • Click on the New Resource Button from the Toolbox
  • Resource Type = Formula
  • API Name = SetTimeToNow
  • Data Type = Date/Time
  • Formula = NOW()

Selective Processing Flow2png.png

 

Create a new Update Records Element:

  • Add a new Update Records Element to the Flow by clicking the + sign and selecting Update Records from the Data section
  • Label = Enable Case Flags
  • API Name = Enable_Case_Flags
  • How to Find Records to Update and Set Their Values = Use the case record that triggered the Flow
  • Set Filter Conditions = All Conditions Are Met (AND); Field = Type and set the specific Case Types that should be used for selective processing in Case Flags
  • Set Field Values for the Case Record
    • Field 1 = FLAGS__Enable_Case_Flags__c; Value = True
    • Field 2 = FLAGS__ViewedFlag__c; Value = SetTimeToNow

Selective Processing Flow3.png

 

Click on the Save button and name your Flow.

 

Selective Processing Flow4.png

 

Activate and test your Flow.

 

 

Documentation Name
Organization Wide/Selective Processing