Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>65.0</apiVersion>
<customErrors>
<name>Error_Limit_of_1_Record</name>
<label>Error - Limit of 1 Record</label>
<locationX>0</locationX>
<locationY>0</locationY>
<customErrorMessages>
<errorMessage>Only one Unsubscribe Link Setup record can exist at a time. Use the setup flow rather than creating a record manually.</errorMessage>
<isFieldError>false</isFieldError>
</customErrorMessages>
</customErrors>
<decisions>
<name>Record_Found</name>
<label>Record Found?</label>
<locationX>0</locationX>
<locationY>0</locationY>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Yes_Found</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Get_Existing_Unsubscribe_Link_Setups</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>false</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Error_Limit_of_1_Record</targetReference>
</connector>
<label>Yes - Found</label>
</rules>
</decisions>
<description>Before create, will check to see if any existing Unsubscribe Link Setup records exist, and throw an error if one already exists as only one should be in the org at a time.</description>
<environments>Default</environments>
<interviewLabel>Unsubscribe Link Setup {!$Flow.CurrentDateTime}</interviewLabel>
<label>Unsubscribe Link Setup | Maximum of One Record</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordLookups>
<description>Query for any existing Unsubscribe Link Setup records</description>
<name>Get_Existing_Unsubscribe_Link_Setups</name>
<label>Get Existing Unsubscribe Link Setups</label>
<locationX>0</locationX>
<locationY>0</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Record_Found</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>NotEqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Unsubscribe_Link_Setup__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<start>
<locationX>0</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Existing_Unsubscribe_Link_Setups</targetReference>
</connector>
<object>Unsubscribe_Link_Setup__c</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordBeforeSave</triggerType>
</start>
<status>Active</status>
</Flow>