Skip to content

Commit 7809215

Browse files
authored
Adds Unsubscribe_Link_Setup_Maximum_of_One_Record flow
Flow previously included in pr #187 Signed-off-by: DKeatonDC <[email protected]>
1 parent d2115c5 commit 7809215

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>65.0</apiVersion>
4+
<customErrors>
5+
<name>Error_Limit_of_1_Record</name>
6+
<label>Error - Limit of 1 Record</label>
7+
<locationX>0</locationX>
8+
<locationY>0</locationY>
9+
<customErrorMessages>
10+
<errorMessage>Only one Unsubscribe Link Setup record can exist at a time. Use the setup flow rather than creating a record manually.</errorMessage>
11+
<isFieldError>false</isFieldError>
12+
</customErrorMessages>
13+
</customErrors>
14+
<decisions>
15+
<name>Record_Found</name>
16+
<label>Record Found?</label>
17+
<locationX>0</locationX>
18+
<locationY>0</locationY>
19+
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
20+
<rules>
21+
<name>Yes_Found</name>
22+
<conditionLogic>and</conditionLogic>
23+
<conditions>
24+
<leftValueReference>Get_Existing_Unsubscribe_Link_Setups</leftValueReference>
25+
<operator>IsNull</operator>
26+
<rightValue>
27+
<booleanValue>false</booleanValue>
28+
</rightValue>
29+
</conditions>
30+
<connector>
31+
<targetReference>Error_Limit_of_1_Record</targetReference>
32+
</connector>
33+
<label>Yes - Found</label>
34+
</rules>
35+
</decisions>
36+
<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>
37+
<environments>Default</environments>
38+
<interviewLabel>Unsubscribe Link Setup {!$Flow.CurrentDateTime}</interviewLabel>
39+
<label>Unsubscribe Link Setup | Maximum of One Record</label>
40+
<processMetadataValues>
41+
<name>BuilderType</name>
42+
<value>
43+
<stringValue>LightningFlowBuilder</stringValue>
44+
</value>
45+
</processMetadataValues>
46+
<processMetadataValues>
47+
<name>CanvasMode</name>
48+
<value>
49+
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
50+
</value>
51+
</processMetadataValues>
52+
<processMetadataValues>
53+
<name>OriginBuilderType</name>
54+
<value>
55+
<stringValue>LightningFlowBuilder</stringValue>
56+
</value>
57+
</processMetadataValues>
58+
<processType>AutoLaunchedFlow</processType>
59+
<recordLookups>
60+
<description>Query for any existing Unsubscribe Link Setup records</description>
61+
<name>Get_Existing_Unsubscribe_Link_Setups</name>
62+
<label>Get Existing Unsubscribe Link Setups</label>
63+
<locationX>0</locationX>
64+
<locationY>0</locationY>
65+
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
66+
<connector>
67+
<targetReference>Record_Found</targetReference>
68+
</connector>
69+
<filterLogic>and</filterLogic>
70+
<filters>
71+
<field>Id</field>
72+
<operator>NotEqualTo</operator>
73+
<value>
74+
<elementReference>$Record.Id</elementReference>
75+
</value>
76+
</filters>
77+
<getFirstRecordOnly>true</getFirstRecordOnly>
78+
<object>Unsubscribe_Link_Setup__c</object>
79+
<storeOutputAutomatically>true</storeOutputAutomatically>
80+
</recordLookups>
81+
<start>
82+
<locationX>0</locationX>
83+
<locationY>0</locationY>
84+
<connector>
85+
<targetReference>Get_Existing_Unsubscribe_Link_Setups</targetReference>
86+
</connector>
87+
<object>Unsubscribe_Link_Setup__c</object>
88+
<recordTriggerType>Create</recordTriggerType>
89+
<triggerType>RecordBeforeSave</triggerType>
90+
</start>
91+
<status>Active</status>
92+
</Flow>

0 commit comments

Comments
 (0)