Skip to content

Commit

Permalink
Merge pull request #178 from SalesforceLabs/feature/flowupdatesRSPCA
Browse files Browse the repository at this point in the history
Feature/flowupdates rspca
  • Loading branch information
GeekStewie authored Nov 11, 2024
2 parents 1a488fb + 6d17628 commit 49d66a7
Show file tree
Hide file tree
Showing 82 changed files with 1,374 additions and 619 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private class ASCS_MovementTriggerHandlerTest {
);

insert locationSite;

animalshelters__Locations__c locationBlock = new animalshelters__Locations__c(
animalshelters__Name__c = 'Test Location Block',
recordTypeId = blockRecordTypeId,
Expand All @@ -43,7 +43,7 @@ private class ASCS_MovementTriggerHandlerTest {

locationList.add(location1);
locationList.add(location2);

// Insert unit locations
insert locationList;

Expand Down Expand Up @@ -96,7 +96,7 @@ private class ASCS_MovementTriggerHandlerTest {

// Query both locations for allocation check
List<animalshelters__Locations__c> updatedLocations = [SELECT Id, animalshelters__Allocation__c FROM animalshelters__Locations__c WHERE Id IN :new Set<Id>{location1.Id, location2.Id}];

// Verify allocations after the movements
for (animalshelters__Locations__c loc : updatedLocations) {
if (loc.Id == location1.Id) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomIndex xmlns="http://soap.sforce.com/2006/04/metadata">
<allowNullValues>false</allowNullValues>
</CustomIndex>
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
<identifier>RecordActive_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-92cdd80a-d30e-4517-98bf-a61936ed30e8</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<identifier>RecordDate_of_Adoption__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-6e2c0e1b-75a5-4aa2-89e5-0a79927298c4</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
<identifier>RecordAction_Completed_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-629621b5-076b-4e74-aeb8-d9061f6f3833</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
<identifier>RecordSeverity_Level_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-e4493684-ec5a-4587-8870-1d5482cbb764</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
<identifier>RecordCalculated_Age__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-4c49db03-428d-4fcb-a44e-6e9be7ede66a</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<identifier>Recordanimalshelters_Age_Category_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-c9f85fdf-9f3e-459a-9111-1a24e639d1a0</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
<identifier>RecordStatus__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-e0a8926f-51de-44d3-b00c-5e840edb0236</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
<identifier>RecordCategory_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-9cb348dd-c2b1-489e-8c93-93b664cc0fc9</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
<identifier>RecordLatin_Name_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-364e5636-e37f-406b-a65a-3fc58ea55842</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@
<identifier>RecordAnimal__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-4c5a0987-2949-4f04-bd61-2a752918f3f3</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
<identifier>Recordanimalshelters_Unit_Status_cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-03fd539c-8e0f-4eb0-b151-8bee0ddb7e23</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@
<identifier>RecordTotal_Time_Days__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.External_Id__c</fieldItem>
<identifier>Recordanimalshelters__External_Id__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-400ba8ed-d34a-4edc-9892-e306423d174c</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@
<name>AutoMatchEnabledScreenDataTable</name>
<dataTypeMappings>
<typeName>T</typeName>
<typeValue>animalshelters__Adoption_Match__c</typeValue>
<typeValue>Adoption_Match__c</typeValue>
</dataTypeMappings>
<extensionName>flowruntime:datatable</extensionName>
<fieldType>ComponentInstance</fieldType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<targetReference>Create_Action_Task</targetReference>
</connector>
<filterFormula>
{!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
{!$Setup.Animal_Shelter_Settings__c.Enable_Animal_Action_Tasks__c}=TRUE</filterFormula>
<object>Animal_Action__c</object>
<recordTriggerType>Create</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>60.0</apiVersion>
<description>[Animal Shelter] - When Adoption Status = Adopted: Update Contact Flag, Clear current and create new Movement record, update Animal status and details</description>
<description>[Animal Shelter] - When Adoption Status = Adopted: Update Contact Flag, Clear
current and create new Movement record, update Animal status and details</description>
<environments>Default</environments>
<formulas>
<name>formulaAdoptionDate</name>
<dataType>Date</dataType>
<expression>IF(ISBLANK({!$Record.animalshelters__Date_of_Adoption__c}) , {!$Flow.CurrentDate}, {!$Record.animalshelters__Date_of_Adoption__c})</expression>
<expression>IF(ISBLANK({!$Record.animalshelters__Date_of_Adoption__c}) ,
{!$Flow.CurrentDate}, {!$Record.animalshelters__Date_of_Adoption__c})</expression>
</formulas>
<formulas>
<name>formulaCollectedDate</name>
<dataType>Date</dataType>
<expression>IF(ISBLANK({!$Record.animalshelters__Date_Collected__c}) , {!$Flow.CurrentDate}, {!$Record.animalshelters__Date_Collected__c})</expression>
<expression>IF(ISBLANK({!$Record.animalshelters__Date_Collected__c}) , {!$Flow.CurrentDate},
{!$Record.animalshelters__Date_Collected__c})</expression>
</formulas>
<interviewLabel>Animal - Adoption Update Automation</interviewLabel>
<isTemplate>true</isTemplate>
Expand All @@ -36,7 +39,8 @@
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<description>Creates a new Movement Record, of Type Adopted with the Start Date = to Date Collected</description>
<description>Creates a new Movement Record, of Type Adopted with the Start Date = to Date
Collected</description>
<name>Create_New_Movement_Record</name>
<label>Create New Movement Record</label>
<locationX>176</locationX>
Expand Down Expand Up @@ -220,7 +224,8 @@
<object>Movement__c</object>
</recordUpdates>
<recordUpdates>
<description>Sets the &quot;Is An Adopter&quot; Flag on the associated Contact to indicate they are an Adopter</description>
<description>Sets the &quot;Is An Adopter&quot; Flag on the associated Contact to indicate
they are an Adopter</description>
<name>Set_Adopter_Flag_on_Contact_to_True</name>
<label>Set Adopter Flag on Contact to True</label>
<locationX>176</locationX>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<targetReference>Get_Locations_Child_Records</targetReference>
</connector>
</start>
<status>Active</status>
<status>Obsolete</status>
<variables>
<name>varAvailableCount</name>
<dataType>Number</dataType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@
<allowPause>false</allowPause>
<fields>
<name>Completed_Text</name>
<fieldText>&lt;p&gt;&lt;strong&gt;Records Updated!&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;All units in {!recordId.Name__c} have been updated to {!SelectedChoice}. Click Finish to complete the wizard.&lt;/p&gt;</fieldText>
<fieldText>&lt;p&gt;&lt;strong&gt;Records
Updated!&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;All units in
{!recordId.Name__c} have been updated to {!SelectedChoice}. Click Finish to complete
the wizard.&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<showFooter>true</showFooter>
Expand All @@ -409,7 +412,13 @@
<allowPause>false</allowPause>
<fields>
<name>Error_Screen_Text</name>
<fieldText>&lt;p&gt;There has been an error in the flow when it attempting to update records.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Click the Previous button below to go back and try again. If the problem persists, contact your &lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);&quot;&gt;Salesforce administrator with &lt;/span&gt;the fault message below.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Fault Message:&lt;/p&gt;&lt;p&gt;{!$Flow.FaultMessage}&lt;/p&gt;</fieldText>
<fieldText>&lt;p&gt;There has been an error in the flow when it attempting to update
records.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Click the Previous button
below to go back and try again. If the problem persists, contact your &lt;span
style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68,
68);&quot;&gt;Salesforce administrator with &lt;/span&gt;the fault message
below.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Fault
Message:&lt;/p&gt;&lt;p&gt;{!$Flow.FaultMessage}&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<showFooter>true</showFooter>
Expand All @@ -425,7 +434,13 @@
<allowPause>false</allowPause>
<fields>
<name>Copy_1_of_Has_Allocated_Units_Text</name>
<fieldText>&lt;p&gt;Block/Sub Block &lt;strong&gt;&lt;em&gt;{!recordId.Name__c}&lt;/em&gt;&lt;/strong&gt; has at least 1 unit that is housing an animal, and is allocated. &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Please make arrangements to move the animals out of any units in this Block/Sub Block.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Click &lt;strong&gt;Finish&lt;/strong&gt; to Exit&lt;/p&gt;</fieldText>
<fieldText>&lt;p&gt;Block/Sub Block
&lt;strong&gt;&lt;em&gt;{!recordId.Name__c}&lt;/em&gt;&lt;/strong&gt; has at least 1
unit that is housing an animal, and is allocated.
&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Please make arrangements to move the
animals out of any units in this Block/Sub
Block.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Click
&lt;strong&gt;Finish&lt;/strong&gt; to Exit&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<showFooter>true</showFooter>
Expand All @@ -444,7 +459,8 @@
</connector>
<fields>
<name>Start_Screen_Text</name>
<fieldText>&lt;p&gt;To change the status of the current Block or Sub Block and all its units, select an option below&lt;/p&gt;</fieldText>
<fieldText>&lt;p&gt;To change the status of the current Block or Sub Block and all its
units, select an option below&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<fields>
Expand All @@ -457,7 +473,10 @@
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>false</isRequired>
</fields>
<helpText>&lt;p&gt;This wizard allows you to update the status for all units within a single block at the same time. &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;For example if the block needs to be closed for maintenance, you can use this to update the whole block to unavailable.&lt;/p&gt;</helpText>
<helpText>&lt;p&gt;This wizard allows you to update the status for all units within a single
block at the same time. &lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;For example if
the block needs to be closed for maintenance, you can use this to update the whole block
to unavailable.&lt;/p&gt;</helpText>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
<description>Matched to Custom Setting</description>
<name>BreedsMigrationComplete</name>
<dataType>Boolean</dataType>
<expression>{!$Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Breeds_Migration_Complete__c}</expression>
<expression>{!$Setup.Animal_Shelter_Settings__c.Breeds_Migration_Complete__c}</expression>
</formulas>
<interviewLabel>Animal - Breeds Migration Flow {!$Flow.CurrentDateTime}</interviewLabel>
<isTemplate>true</isTemplate>
Expand Down
Loading

0 comments on commit 49d66a7

Please sign in to comment.