-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from SalesforceLabs/feature/AdoptionContactFlag
Feature/adoption contact flag
- Loading branch information
Showing
36 changed files
with
1,117 additions
and
2 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
force-app/main/default/animationRules/Adoption_Path.animationRule-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
260 changes: 260 additions & 0 deletions
260
force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.