Skip to content

Commit

Permalink
Merge pull request #67 from SalesforceLabs/feature/AdoptionContactFlag
Browse files Browse the repository at this point in the history
Feature/adoption contact flag
  • Loading branch information
GeekStewie authored Jun 13, 2022
2 parents 2aa1746 + ea7cf21 commit e724daf
Show file tree
Hide file tree
Showing 36 changed files with 1,117 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<AnimationRule xmlns="http://soap.sforce.com/2006/04/metadata">
<animationFrequency>rarely</animationFrequency>
<developerName>Adoption_Path</developerName>
<isActive>true</isActive>
<masterLabel>Adoption Path</masterLabel>
<recordTypeContext>Master</recordTypeContext>
<recordTypeName>__MASTER__</recordTypeName>
<sobjectType>Adoption__c</sobjectType>
<targetField>Adoption_Stage__c</targetField>
<targetFieldChangeToValues>Adopted</targetFieldChangeToValues>
</AnimationRule>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@
<identifier>force_highlightsPanel</identifier>
</componentInstance>
</itemInstances>
<itemInstances>
<componentInstance>
<componentInstanceProperties>
<name>hideUpdateButton</name>
<value>false</value>
</componentInstanceProperties>
<componentInstanceProperties>
<name>variant</name>
<value>linear</value>
</componentInstanceProperties>
<componentName>runtime_sales_pathassistant:pathAssistant</componentName>
<identifier>runtime_sales_pathassistant_pathAssistant1</identifier>
</componentInstance>
</itemInstances>
<mode>Replace</mode>
<name>header</name>
<type>Region</type>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>54.0</apiVersion>
<description>On Adoption Status = Adopted, Update Contact Flag, Clear current and create new Movement record, update Animal status</description>
<interviewLabel>Animal - Adoption Update Automation {!$Flow.CurrentDateTime}</interviewLabel>
<label>Animal - Adoption Update Automation</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>
<recordCreates>
<name>Create_New_Movement_Record</name>
<label>Create New Movement Record</label>
<locationX>176</locationX>
<locationY>935</locationY>
<connector>
<targetReference>Update_Animal_Record</targetReference>
</connector>
<inputAssignments>
<field>Animal__c</field>
<value>
<elementReference>Get_Adoption_Record.Animal__r.Id</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Current__c</field>
<value>
<booleanValue>true</booleanValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Start_Date__c</field>
<value>
<elementReference>$Flow.CurrentDate</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Type__c</field>
<value>
<stringValue>Adopted, See Adoption Record</stringValue>
</value>
</inputAssignments>
<object>Movement__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<recordLookups>
<name>Get_Adoption_Record</name>
<label>Get Adoption Record</label>
<locationX>176</locationX>
<locationY>335</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Associated_Contact_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>$Record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Adoption__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Associated_Contact_Record</name>
<label>Get Associated Contact Record</label>
<locationX>176</locationX>
<locationY>455</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Set_Adopter_Flag_on_Contact_to_True</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Adoption_Record.Primary_Contact__r.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Current_Movement_Record</name>
<label>Get Current Movement Record</label>
<locationX>176</locationX>
<locationY>695</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Close_current_Movement_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Animal__c</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Adoption_Record.Animal__r.Id</elementReference>
</value>
</filters>
<filters>
<field>Current__c</field>
<operator>EqualTo</operator>
<value>
<booleanValue>true</booleanValue>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Movement__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordUpdates>
<name>Close_current_Movement_Record</name>
<label>Close current Movement Record</label>
<locationX>176</locationX>
<locationY>815</locationY>
<connector>
<targetReference>Create_New_Movement_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Current_Movement_Record.Id</elementReference>
</value>
</filters>
<inputAssignments>
<field>Current__c</field>
<value>
<booleanValue>false</booleanValue>
</value>
</inputAssignments>
<inputAssignments>
<field>End_Date__c</field>
<value>
<elementReference>$Flow.CurrentDate</elementReference>
</value>
</inputAssignments>
<object>Movement__c</object>
</recordUpdates>
<recordUpdates>
<name>Set_Adopter_Flag_on_Contact_to_True</name>
<label>Set Adopter Flag on Contact to True</label>
<locationX>176</locationX>
<locationY>575</locationY>
<connector>
<targetReference>Get_Current_Movement_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Associated_Contact_Record.Id</elementReference>
</value>
</filters>
<inputAssignments>
<field>Is_an_Adopter__c</field>
<value>
<booleanValue>true</booleanValue>
</value>
</inputAssignments>
<object>Contact</object>
</recordUpdates>
<recordUpdates>
<description>Update Date of Adoption on Adoption Record</description>
<name>Update_Adoption_Record</name>
<label>Update Adoption Record</label>
<locationX>176</locationX>
<locationY>1175</locationY>
<inputAssignments>
<field>Date_Collected__c</field>
<value>
<elementReference>$Flow.CurrentDate</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>Date_of_Adoption__c</field>
<value>
<elementReference>$Flow.CurrentDate</elementReference>
</value>
</inputAssignments>
<inputReference>$Record</inputReference>
</recordUpdates>
<recordUpdates>
<name>Update_Animal_Record</name>
<label>Update Animal Record</label>
<locationX>176</locationX>
<locationY>1055</locationY>
<connector>
<targetReference>Update_Adoption_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Adoption_Record.Animal__r.Id</elementReference>
</value>
</filters>
<inputAssignments>
<field>Animal_Status__c</field>
<value>
<stringValue>Adopted</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Location_Status__c</field>
<value>
<stringValue>Adopted - See Adoption Record</stringValue>
</value>
</inputAssignments>
<inputAssignments>
<field>Previous_Current_Owner__c</field>
<value>
<elementReference>Get_Associated_Contact_Record.Id</elementReference>
</value>
</inputAssignments>
<object>Animal__c</object>
</recordUpdates>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Adoption_Record</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Adoption_Stage__c</field>
<operator>EqualTo</operator>
<value>
<stringValue>Adopted</stringValue>
</value>
</filters>
<object>Adoption__c</object>
<recordTriggerType>Update</recordTriggerType>
<triggerType>RecordAfterSave</triggerType>
</start>
<status>Active</status>
</Flow>
Loading

0 comments on commit e724daf

Please sign in to comment.