diff --git a/force-app/main/default/flows/Unsubscribe_Link_Setup_Maximum_of_One_Record.flow-meta.xml b/force-app/main/default/flows/Unsubscribe_Link_Setup_Maximum_of_One_Record.flow-meta.xml new file mode 100644 index 0000000..b4aff8c --- /dev/null +++ b/force-app/main/default/flows/Unsubscribe_Link_Setup_Maximum_of_One_Record.flow-meta.xml @@ -0,0 +1,92 @@ + + + 65.0 + + Error_Limit_of_1_Record + + 0 + 0 + + Only one Unsubscribe Link Setup record can exist at a time. Use the setup flow rather than creating a record manually. + false + + + + Record_Found + + 0 + 0 + Default Outcome + + Yes_Found + and + + Get_Existing_Unsubscribe_Link_Setups + IsNull + + false + + + + Error_Limit_of_1_Record + + + + + 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. + Default + Unsubscribe Link Setup {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Query for any existing Unsubscribe Link Setup records + Get_Existing_Unsubscribe_Link_Setups + + 0 + 0 + false + + Record_Found + + and + + Id + NotEqualTo + + $Record.Id + + + true + Unsubscribe_Link_Setup__c + true + + + 0 + 0 + + Get_Existing_Unsubscribe_Link_Setups + + Unsubscribe_Link_Setup__c + Create + RecordBeforeSave + + Active +