From b92501cb709d0207101966a079e8b7a0948b5413 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Mon, 13 Jan 2025 17:20:10 +0000 Subject: [PATCH 1/9] New Relationship Fields, RecordTypes and Flow --- .../Animal_Record_Page.flexipage-meta.xml | 164 ++++++++- ...elationship_Record_Page.flexipage-meta.xml | 18 + .../Animal_New_Relationship.flow-meta.xml | 343 ++++++++++++++++++ ...tact_Relationships.globalValueSet-meta.xml | 25 ++ ...Animal Relationship Layout.layout-meta.xml | 12 + .../Animal_Relationship__c.object-meta.xml | 1 + .../fields/Contact_Name__c.field-meta.xml | 13 + .../fields/Contact__c.field-meta.xml | 14 + .../Relationship_Types__c.field-meta.xml | 14 + .../Animal_Relationship.recordType-meta.xml | 37 ++ .../Contact_Relationship.recordType-meta.xml | 37 ++ 11 files changed, 671 insertions(+), 7 deletions(-) create mode 100644 force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml create mode 100644 force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Contact__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml diff --git a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml index 7b735e28..c1531f7f 100644 --- a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml @@ -2195,6 +2195,17 @@ + + adminFilters + + + RECORDTYPE|EQUALS|["Animal_Relationship"] + + + Status__c|EQUALS|["Current"] + + + maxRecordsToDisplay 10 @@ -2215,22 +2226,19 @@ relatedListFieldAliases - NAME + Related_Animal_Name__c - Related_Animal__c + Relationship_Types__c - Related_Animal_Name__c - - - Status__c + NAME relatedListLabel - Animal Relationships + Active Animal Relationships showActionBar @@ -2248,6 +2256,148 @@ lst_dynamicRelatedList9 + + + + actionNames + + + New + + + + + adminFilters + + + RECORDTYPE|EQUALS|["Contact_Relationship"] + + + Status__c|EQUALS|["Current"] + + + + + maxRecordsToDisplay + 10 + + + parentFieldApiName + Animal__c.Id + + + relatedListApiName + Animal_Relationships__r + + + relatedListDisplayType + ADVGRID + + + relatedListFieldAliases + + + Contact_Name__c + + + Relationship_Types__c + + + NAME + + + + + relatedListLabel + Active Animal/Contact Relationships + + + showActionBar + true + + + sortFieldAlias + __DEFAULT__ + + + sortFieldOrder + Default + + lst:dynamicRelatedList + lst_dynamicRelatedList11 + + + + + + actionNames + + + New + + + + + adminFilters + + + Status__c|EQUALS|["Archived"] + + + + + maxRecordsToDisplay + 10 + + + parentFieldApiName + Animal__c.Id + + + relatedListApiName + Animal_Relationships__r + + + relatedListDisplayType + ADVGRID + + + relatedListFieldAliases + + + Animal_Name__c + + + Contact_Name__c + + + Relationship_Types__c + + + NAME + + + + + relatedListLabel + Archived Relationships + + + showActionBar + true + + + sortFieldAlias + __DEFAULT__ + + + sortFieldOrder + Default + + lst:dynamicRelatedList + lst_dynamicRelatedList12 + + Facet-d29ddff1-4c2b-41b7-8464-4022c20ebe8b Facet diff --git a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml index 0528963c..9e2423a7 100644 --- a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml @@ -105,6 +105,24 @@ Recordanimalshelters__External_Id__cField + + + Record.Contact__c + Recordanimalshelters__Contact__cField + + + + + Record.Relationship_Types__c + Recordanimalshelters__Relationship_Types__cField + + + + + Record.Contact_Name__c + Recordanimalshelters__Contact_Name__cField + + Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 Facet diff --git a/force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml new file mode 100644 index 00000000..5a963d41 --- /dev/null +++ b/force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml @@ -0,0 +1,343 @@ + + + 62.0 + + Assign additional values for New Relationship record + Assign_additional_values + + 182 + 458 + + newRelationship.Status__c + Assign + + Current + + + + newRelationship.Animal__c + Assign + + animalRecord.Id + + + + newRelationship.RecordTypeId + Assign + + Get_Record_Type_for_Animal_Relationship.returnedRecordTypeId + + + + Has_a_row_been_selected + + + + Copy_Selected_Row_Record + + 50 + 674 + + selectedRow + Assign + + AnimalRelationshipsDatatable.firstSelectedRow + + + + Sets_current_relationship_status_to_archived + + + + Sets_current_relationship_status_to_archived + + 50 + 782 + + selectedRow.Status__c + Assign + + Archived + + + + Update_Current_Relationship + + + + Decides whether a Row has been selected for Update + Has_a_row_been_selected + + 182 + 566 + + Create_New_Relationship + + No Row Selected + + Row_Selected + and + + AnimalRelationshipsDatatable.firstSelectedRow + IsNull + + false + + + + Copy_Selected_Row_Record + + + + + Default + Animal - New Relationship {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + Flow + + Create_New_Relationship + + 182 + 1082 + newRelationship + + + Get all current relationships with Contacts for the Animal + Get_Current_Relationships_for_Animal + + 182 + 242 + false + + Animal_Relationships_Screen + + and + + Status__c + EqualTo + + Current + + + + Animal__c + EqualTo + + animalRecord.Id + + + + RecordTypeId + EqualTo + + Get_Record_Type_for_Animal_Relationship.returnedRecordTypeId + + + false + Animal_Relationship__c + true + + + Update_Current_Relationship + + 50 + 890 + + Create_New_Relationship + + selectedRow + + + Animal_Relationships_Screen + + 182 + 350 + false + true + true + + Assign_additional_values + + + Animal_Relationships_Screen_Section1 + RegionContainer + + Animal_Relationships_Screen_Section1_Column1 + Region + + Animal_Relationships_Screen_Text + <p>Select a existing relationship to update, and choose the Contact and relationship.</p><p>Or create a new relationship</p> + DisplayText + + + width + + 12 + + + false + + false + SectionWithoutHeader + + + Animal_Relationships_Screen_Section2 + RegionContainer + + Animal_Relationships_Screen_Section2_Column1 + Region + + AnimalRelationshipsDatatable + + T + Animal_Relationship__c + + flowruntime:datatable + ComponentInstance + + selectionMode + + SINGLE_SELECT + + + + minRowSelection + + 0.0 + + + + tableData + + Get_Current_Relationships_for_Animal + + + + shouldDisplayLabel + + true + + + + maxRowSelection + + 1.0 + + + + columns + + [{"apiName":"animalshelters__Contact_Name__c","guid":"column-0029","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":0,"label":"Contact Name","type":"customRichText"},{"apiName":"animalshelters__Relationship_Types__c","guid":"column-6c43","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":1,"label":"Relationship Types","type":"text"}] + + + + label + + Animal Relationships + + + UseStoredValues + true + true + + + width + + 12 + + + false + + false + SectionWithoutHeader + + + ObjectProvided + UseStoredValues + false + newRelationship.Contact__c + + + ObjectProvided + UseStoredValues + false + newRelationship.Relationship_Types__c + + true + true + + + 56 + 0 + + Get_Record_Type_for_Animal_Relationship + + + Draft + + Gets the RecordType ID for the Animal_Relationship RecordType on the Relationships object + Get_Record_Type_for_Animal_Relationship + + 182 + 134 + + Get_Current_Relationships_for_Animal + + Animal_RecordType_Subflow + + developerName + + Contact_Relationship + + + + sObjectName + + animalshelters__Animal_Relationship__c + + + true + + + animalRecord + SObject + false + true + false + Animal__c + + + newRelationship + SObject + false + false + false + Animal_Relationship__c + + + selectedRow + SObject + false + false + false + Animal_Relationship__c + + diff --git a/force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml b/force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml new file mode 100644 index 00000000..c2dadb03 --- /dev/null +++ b/force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml @@ -0,0 +1,25 @@ + + + + Owner + false + + + + Trainer + false + + + + Foster + false + + + + Carer + false + + + Animal Contact Relationships + false + diff --git a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml index 3d9c30c5..dfaa8e6b 100644 --- a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml +++ b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml @@ -19,6 +19,18 @@ Edit Status__c + + Edit + Contact__c + + + Edit + Relationship_Types__c + + + Readonly + Contact_Name__c + diff --git a/force-app/main/default/objects/Animal_Relationship__c/Animal_Relationship__c.object-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/Animal_Relationship__c.object-meta.xml index 1d7cc417..c9a5bc54 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/Animal_Relationship__c.object-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/Animal_Relationship__c.object-meta.xml @@ -168,6 +168,7 @@ AutoNumber Animal Relationships + false ReadWrite Vowel diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml new file mode 100644 index 00000000..3d08e93f --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Contact_Name__c + false + Contact__r.FirstName & Contact__r.LastName + BlankAsZero + + false + false + false + Text + false + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Contact__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Contact__c.field-meta.xml new file mode 100644 index 00000000..28ad17e7 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Contact__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Contact__c + SetNull + false + + Contact + Animal Relationships + Animal_Relationships + false + false + false + Lookup + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml new file mode 100644 index 00000000..3bcc8c25 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Relationship_Types__c + false + + false + false + false + Picklist + + true + Animal_Contact_Relationships + + diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml new file mode 100644 index 00000000..2d55f922 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml @@ -0,0 +1,37 @@ + + + Animal_Relationship + true + Relationships between Animals + + + Relationship_Types__c + + Carer + false + + + Foster + false + + + Owner + false + + + Trainer + false + + + + Status__c + + Archived + false + + + Current + true + + + diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml new file mode 100644 index 00000000..f760fd35 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml @@ -0,0 +1,37 @@ + + + Contact_Relationship + true + Relationships between Contacts and Animals + + + Relationship_Types__c + + Carer + false + + + Foster + false + + + Owner + false + + + Trainer + false + + + + Status__c + + Archived + false + + + Current + true + + + From b81bd59abd36a0ceec8c161c64fd468c8ffc788c Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Tue, 14 Jan 2025 14:38:01 +0000 Subject: [PATCH 2/9] Updated to include Accounts --- .../Animal_Record_Page.flexipage-meta.xml | 21 ++- ...elationship_Record_Page.flexipage-meta.xml | 26 +++- ...ciprocal_Animal_Relationship.flow-meta.xml | 35 ++++- ...man_Relationship_Management.flow-meta.xml} | 147 ++++++++++++++---- ...mal_Relationships.globalValueSet-meta.xml} | 18 ++- ...Animal Relationship Layout.layout-meta.xml | 46 ++++-- .../fields/Active__c.field-meta.xml | 11 ++ .../fields/End_Date__c.field-meta.xml | 11 ++ ....field-meta.xml => Name__c.field-meta.xml} | 12 +- .../fields/Organisation__c.field-meta.xml | 14 ++ .../Relationship_Types__c.field-meta.xml | 2 +- .../fields/Start_Date__c.field-meta.xml | 11 ++ .../Animal_Relationship.recordType-meta.xml | 14 +- ...=> Human_Relationship.recordType-meta.xml} | 12 +- 14 files changed, 313 insertions(+), 67 deletions(-) rename force-app/main/default/flows/{Animal_New_Relationship.flow-meta.xml => Animal_Human_Relationship_Management.flow-meta.xml} (67%) rename force-app/main/default/globalValueSets/{Animal_Contact_Relationships.globalValueSet-meta.xml => Animal_Relationships.globalValueSet-meta.xml} (53%) create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Active__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/End_Date__c.field-meta.xml rename force-app/main/default/objects/Animal_Relationship__c/fields/{Contact_Name__c.field-meta.xml => Name__c.field-meta.xml} (56%) create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Organisation__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Start_Date__c.field-meta.xml rename force-app/main/default/objects/Animal_Relationship__c/recordTypes/{Contact_Relationship.recordType-meta.xml => Human_Relationship.recordType-meta.xml} (78%) diff --git a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml index c1531f7f..4be113c4 100644 --- a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml @@ -2202,7 +2202,7 @@ RECORDTYPE|EQUALS|["Animal_Relationship"] - Status__c|EQUALS|["Current"] + Active__c|EQUALS|true @@ -2270,10 +2270,10 @@ adminFilters - RECORDTYPE|EQUALS|["Contact_Relationship"] + RECORDTYPE|EQUALS|["Human_Relationship"] - Status__c|EQUALS|["Current"] + Active__c|EQUALS|true @@ -2297,11 +2297,14 @@ relatedListFieldAliases - Contact_Name__c + Name__c Relationship_Types__c + + Start_Date__c + NAME @@ -2341,7 +2344,7 @@ adminFilters - Status__c|EQUALS|["Archived"] + Active__c|EQUALS|false @@ -2368,11 +2371,17 @@ Animal_Name__c - Contact_Name__c + Name__c Relationship_Types__c + + Start_Date__c + + + End_Date__c + NAME diff --git a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml index 9e2423a7..934e95bf 100644 --- a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml @@ -119,10 +119,34 @@ - Record.Contact_Name__c + Record.Name__c Recordanimalshelters__Contact_Name__cField + + + Record.Organisation__c + Recordanimalshelters__Organisation__cField + + + + + Record.Active__c + Recordanimalshelters__Active__cField + + + + + Record.Start_Date__c + Recordanimalshelters__Start_Date__cField + + + + + Record.End_Date__c + Recordanimalshelters__End_Date__cField + + Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 Facet diff --git a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml index d80e6f2b..562ed181 100644 --- a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml @@ -30,13 +30,19 @@ Create_Reciprocal_Relationship 176 - 431 + 539 Animal__c $Record.Related_Animal__r.Id + + RecordTypeId + + Get_Animal_Relationship_Record_Type_ID.returnedRecordTypeId + + Record_Created__c @@ -62,7 +68,7 @@ Update_Origin 176 - 323 + 431 Create_Reciprocal_Relationship @@ -86,7 +92,7 @@ 50 0 - Update_Origin + Get_Animal_Relationship_Record_Type_ID and @@ -101,4 +107,27 @@ RecordAfterSave Active + + Get_Animal_Relationship_Record_Type_ID + + 176 + 323 + + Update_Origin + + Animal_RecordType_Subflow + + developerName + + Animal_Relationship + + + + sObjectName + + animalshelters__Animal_Relationship__c + + + true + diff --git a/force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml similarity index 67% rename from force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml rename to force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml index 5a963d41..13d169d4 100644 --- a/force-app/main/default/flows/Animal_New_Relationship.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml @@ -5,13 +5,13 @@ Assign additional values for New Relationship record Assign_additional_values - 182 + 314 458 - newRelationship.Status__c + newRelationship.Active__c Assign - Current + true @@ -28,6 +28,13 @@ Get_Record_Type_for_Animal_Relationship.returnedRecordTypeId + + newRelationship.Start_Date__c + Assign + + $Flow.CurrentDate + + Has_a_row_been_selected @@ -54,10 +61,17 @@ 50 782 - selectedRow.Status__c + selectedRow.Active__c Assign - Archived + false + + + + selectedRow.End_Date__c + Assign + + $Flow.CurrentDate @@ -68,7 +82,7 @@ Decides whether a Row has been selected for Update Has_a_row_been_selected - 182 + 314 566 Create_New_Relationship @@ -90,9 +104,11 @@ + [Animal Shelter] - Screen flow to manage the relationships between Contacts/Organisations (Accounts) and Animals Default - Animal - New Relationship {!$Flow.CurrentDateTime} - + Animal - Human Relationship Management {!$Flow.CurrentDateTime} + true + BuilderType @@ -115,40 +131,47 @@ Create_New_Relationship - 182 - 1082 + 314 + 1130 + + true + Flow_Error_Screen + newRelationship Get all current relationships with Contacts for the Animal Get_Current_Relationships_for_Animal - 182 + 314 242 false Animal_Relationships_Screen + + Flow_Error_Screen + and - Status__c + Animal__c EqualTo - Current + animalRecord.Id - Animal__c + RecordTypeId EqualTo - animalRecord.Id + Get_Record_Type_for_Animal_Relationship.returnedRecordTypeId - RecordTypeId + Active__c EqualTo - Get_Record_Type_for_Animal_Relationship.returnedRecordTypeId + true false @@ -163,12 +186,16 @@ Create_New_Relationship + + true + Flow_Error_Screen + selectedRow Animal_Relationships_Screen - 182 + 314 350 false true @@ -184,7 +211,7 @@ Region Animal_Relationships_Screen_Text - <p>Select a existing relationship to update, and choose the Contact and relationship.</p><p>Or create a new relationship</p> + <p>Select a existing relationship to update, and choose the Contact or Organisation and relationship.</p><p>Or create a new relationship</p> DisplayText @@ -245,7 +272,7 @@ columns - [{"apiName":"animalshelters__Contact_Name__c","guid":"column-0029","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":0,"label":"Contact Name","type":"customRichText"},{"apiName":"animalshelters__Relationship_Types__c","guid":"column-6c43","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":1,"label":"Relationship Types","type":"text"}] + [{"apiName":"animalshelters__Name__c","guid":"column-23e3","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":0,"label":"Name","type":"customRichText"},{"apiName":"animalshelters__Relationship_Types__c","guid":"column-6c43","editable":false,"hasCustomHeaderLabel":false,"customHeaderLabel":"","wrapText":true,"order":1,"label":"Relationship Types","type":"text"}] @@ -270,10 +297,60 @@ SectionWithoutHeader - ObjectProvided - UseStoredValues + Animal_Relationships_Screen_Section3 + RegionContainer + + Animal_Relationships_Screen_Section3_Column1 + Region + + ObjectProvided + UseStoredValues + false + newRelationship.Contact__c + + + width + + 4 + + + false + + + Animal_Relationships_Screen_Section3_Column2 + Region + + Animal_Relationships_Screen_Text_2 + <p style="text-align: center;"><strong style="font-size: 24px;">Or</strong></p> + DisplayText + + + width + + 4 + + + false + + + Animal_Relationships_Screen_Section3_Column3 + Region + + ObjectProvided + UseStoredValues + false + newRelationship.Organisation__c + + + width + + 4 + + + false + false - newRelationship.Contact__c + SectionWithoutHeader ObjectProvided @@ -284,19 +361,35 @@ true true + + Flow_Error_Screen + + 1018 + 350 + true + true + true + + Flow_Error_Screen_Text + <p>There has been a problem with the Flow. Please contact your administrator with the following information:</p><p><br></p><p>{!$Flow.CurrentDateTime}</p><p>{!$Flow.FaultMessage}</p><p>{!$User.Username}</p> + DisplayText + + true + true + - 56 + 188 0 Get_Record_Type_for_Animal_Relationship - Draft + Active Gets the RecordType ID for the Animal_Relationship RecordType on the Relationships object Get_Record_Type_for_Animal_Relationship - 182 + 314 134 Get_Current_Relationships_for_Animal @@ -305,7 +398,7 @@ developerName - Contact_Relationship + Human_Relationship diff --git a/force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml b/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml similarity index 53% rename from force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml rename to force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml index c2dadb03..2acb0bf1 100644 --- a/force-app/main/default/globalValueSets/Animal_Contact_Relationships.globalValueSet-meta.xml +++ b/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml @@ -20,6 +20,22 @@ false - Animal Contact Relationships + + Parent/Child + false + + + + Sibling + false + + + + Breeder + false + + + [Animal Shelter] List of Relationships between Animal-to-Animal and Contact-to-Animal + Animal Relationships false diff --git a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml index dfaa8e6b..66d51854 100644 --- a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml +++ b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml @@ -1,6 +1,5 @@ - OpenSlackRecordChannel false false @@ -17,32 +16,59 @@ Edit - Status__c + Relationship_Types__c + + + + + Readonly + Related_Animal_Name__c Edit - Contact__c + Related_Animal__c Edit - Relationship_Types__c + Status__c + + + + + + true + true + true + + + + Edit + Contact__c Readonly - Contact_Name__c + Name__c + + + Edit + Organisation__c - Readonly - Related_Animal_Name__c + Edit + Active__c Edit - Related_Animal__c + Start_Date__c + + + Edit + End_Date__c - + false @@ -110,7 +136,7 @@ false false - 00h8F000006l3LB + 00hKU000000kgYs 4 0 Default diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Active__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Active__c.field-meta.xml new file mode 100644 index 00000000..dbfe36e5 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Active__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Active__c + false + [Animal Shelter] Indicates whether this relationship is active + false + + false + false + Checkbox + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/End_Date__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/End_Date__c.field-meta.xml new file mode 100644 index 00000000..4dc2b447 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/End_Date__c.field-meta.xml @@ -0,0 +1,11 @@ + + + End_Date__c + [Animal Shelter] The end date of the relationship + false + + false + false + false + Date + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml similarity index 56% rename from force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml rename to force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml index 3d08e93f..8eae206d 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/fields/Contact_Name__c.field-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml @@ -1,10 +1,16 @@ - Contact_Name__c + Name__c false - Contact__r.FirstName & Contact__r.LastName + IF( + NOT(ISBLANK( Contact__c )), Contact__r.FirstName & " " & Contact__r.LastName, + + IF( + NOT(ISBLANK( Organisation__c )), Organisation__r.Name, " " + ) +) BlankAsZero - + false false false diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Organisation__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Organisation__c.field-meta.xml new file mode 100644 index 00000000..b79c9588 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Organisation__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Organisation__c + SetNull + false + + Account + Animal Relationships + Animal_Relationships + false + false + false + Lookup + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml index 3bcc8c25..8969fc01 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Relationship_Types__c.field-meta.xml @@ -9,6 +9,6 @@ Picklist true - Animal_Contact_Relationships + Animal_Relationships diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Start_Date__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Start_Date__c.field-meta.xml new file mode 100644 index 00000000..71f0169b --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Start_Date__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Start_Date__c + [Animal Shelter] The start date of the relationship + false + + false + false + false + Date + diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml index 2d55f922..42d0514a 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Animal_Relationship.recordType-meta.xml @@ -7,19 +7,11 @@ Relationship_Types__c - Carer - false - - - Foster - false - - - Owner - false + Parent%2FChild + true - Trainer + Sibling false diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml similarity index 78% rename from force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml rename to force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml index f760fd35..df762d98 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Contact_Relationship.recordType-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml @@ -1,11 +1,15 @@ - Contact_Relationship + Human_Relationship true - Relationships between Contacts and Animals - + Relationships between Contacts/Accounts and Animals + Relationship_Types__c + + Breeder + false + Carer false @@ -16,7 +20,7 @@ Owner - false + true Trainer From 90b5f91f245b8cf4c6d6221bdc47d2ca7ce6f7f6 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Tue, 14 Jan 2025 15:49:18 +0000 Subject: [PATCH 3/9] Added Custom Setting --- .../ASSP_Home_Page.flexipage-meta.xml | 36 +++++++++++++++++++ .../animalShelterSettingsEditor.html | 15 ++++++++ ...s_are_not_being_us.validationRule-meta.xml | 13 +++++++ .../Default_Shelter_Name__c.field-meta.xml | 12 +++++++ 4 files changed, 76 insertions(+) create mode 100644 force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml create mode 100644 force-app/main/default/objects/Animal_Shelter_Settings__c/fields/Default_Shelter_Name__c.field-meta.xml diff --git a/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml b/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml index 9ffcd960..c3b40875 100644 --- a/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml @@ -1,6 +1,24 @@ Home page for the Animal Shelter Starter Pack + + + + + decorate + true + + + richTextValue + <h3><strong style="font-size: 12pt; font-family: &quot;Salesforce Sans&quot;, sans-serif; color: rgb(234, 8, 8); background-color: transparent;">Quick Start Checklist</strong></h3><p><span style="font-size: 11pt; font-family: &quot;Salesforce Sans&quot;, sans-serif; color: rgb(0, 0, 0); background-color: transparent;">If this is the first time you have used the Animal Shelter Starter Pack, follow this checklist to confirm correct configuration.&nbsp;</span></p><p><br></p><ol><li><span style="font-size: 11pt; background-color: transparent;">Enable Path</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Animal Action Object</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Location Object</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Contact Object (optional)</span></li><li><span style="color: rgb(68, 68, 68); font-size: 14.6667px;">Update Page Layout assignments on the Account Object (optional)</span></li><li><span style="font-size: 11pt; background-color: transparent;">Load Breeds Data</span></li><li><span style="font-size: 11pt; background-color: transparent;">Review and check Flows</span></li><li><span style="font-size: 11pt; background-color: transparent;">Review and check Custom Settings</span></li><li><span style="font-size: 11pt; background-color: transparent;">Create a Account record for your Shelter which will be used as the default Animal Owner for animals coming into the shelter</span></li><li><span style="font-size: 11pt; background-color: transparent;">Remove this Setup tab from your Home Page</span></li></ol><p><span style="font-size: 11pt; background-color: transparent;">Enjoy </span></p> + + flexipage:richText + flexipage_richText + + + Facet-0b2116d3-6f48-4255-b8e7-f5698a4e9e23 + Facet + @@ -46,6 +64,24 @@ Facet + + + + active + true + + + body + Facet-0b2116d3-6f48-4255-b8e7-f5698a4e9e23 + + + title + Setup + + flexipage:tab + flexipage_tab3 + + diff --git a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html index 947127ae..98f57b4a 100644 --- a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html +++ b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html @@ -163,6 +163,21 @@ + + + +

Default Shelter Name

+

Create an Account for your Shelter and enter the Account Name here. + By default incoming Animals will be given a Owner relationship with this Account.

+
+ + + +
+
diff --git a/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml new file mode 100644 index 00000000..096c05bb --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml @@ -0,0 +1,13 @@ + + + Check_that_both_Lookups_are_not_being_us + true + Checks that the user has only selected an Account (Organisation) or Contact lookup + NOT( + OR( + ISBLANK( Contact__c ), + ISBLANK( Organisation__c ) + ) +) + You cannot select both an Organisation and Contact at the same time in a Relationship! + diff --git a/force-app/main/default/objects/Animal_Shelter_Settings__c/fields/Default_Shelter_Name__c.field-meta.xml b/force-app/main/default/objects/Animal_Shelter_Settings__c/fields/Default_Shelter_Name__c.field-meta.xml new file mode 100644 index 00000000..9fc0e506 --- /dev/null +++ b/force-app/main/default/objects/Animal_Shelter_Settings__c/fields/Default_Shelter_Name__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Default_Shelter_Name__c + The default shelter name that is associated with an Account record + false + + 255 + false + false + Text + false + From 16e32beaa86e00cb1253cfd4c2a8a8d8f31ebd2e Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Thu, 16 Jan 2025 11:33:54 +0000 Subject: [PATCH 4/9] Updated Settings LWC Updated LWC --- .../ASSP_Home_Page.flexipage-meta.xml | 36 ------------------- .../animalShelterSettingsEditor.html | 26 ++++++++++++++ 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml b/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml index c3b40875..9ffcd960 100644 --- a/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/ASSP_Home_Page.flexipage-meta.xml @@ -1,24 +1,6 @@ Home page for the Animal Shelter Starter Pack - - - - - decorate - true - - - richTextValue - <h3><strong style="font-size: 12pt; font-family: &quot;Salesforce Sans&quot;, sans-serif; color: rgb(234, 8, 8); background-color: transparent;">Quick Start Checklist</strong></h3><p><span style="font-size: 11pt; font-family: &quot;Salesforce Sans&quot;, sans-serif; color: rgb(0, 0, 0); background-color: transparent;">If this is the first time you have used the Animal Shelter Starter Pack, follow this checklist to confirm correct configuration.&nbsp;</span></p><p><br></p><ol><li><span style="font-size: 11pt; background-color: transparent;">Enable Path</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Animal Action Object</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Location Object</span></li><li><span style="font-size: 11pt; background-color: transparent;">Update Page Layout assignments on the Contact Object (optional)</span></li><li><span style="color: rgb(68, 68, 68); font-size: 14.6667px;">Update Page Layout assignments on the Account Object (optional)</span></li><li><span style="font-size: 11pt; background-color: transparent;">Load Breeds Data</span></li><li><span style="font-size: 11pt; background-color: transparent;">Review and check Flows</span></li><li><span style="font-size: 11pt; background-color: transparent;">Review and check Custom Settings</span></li><li><span style="font-size: 11pt; background-color: transparent;">Create a Account record for your Shelter which will be used as the default Animal Owner for animals coming into the shelter</span></li><li><span style="font-size: 11pt; background-color: transparent;">Remove this Setup tab from your Home Page</span></li></ol><p><span style="font-size: 11pt; background-color: transparent;">Enjoy </span></p> - - flexipage:richText - flexipage_richText - - - Facet-0b2116d3-6f48-4255-b8e7-f5698a4e9e23 - Facet - @@ -64,24 +46,6 @@ Facet - - - - active - true - - - body - Facet-0b2116d3-6f48-4255-b8e7-f5698a4e9e23 - - - title - Setup - - flexipage:tab - flexipage_tab3 - - diff --git a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html index 98f57b4a..4358dc30 100644 --- a/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html +++ b/force-app/main/default/lwc/animalShelterSettingsEditor/animalShelterSettingsEditor.html @@ -15,6 +15,32 @@ + +
+ + +

Animal Shelter Starter - Setup Checklist

+

If this is the first time you have used the Animal Shelter Starter Pack, + follow this checklist to confirm correct configuration.

+

+
    +
  1. Enable Path
  2. +
  3. Update Page Layout assignments on the Animal Action Object
  4. +
  5. Update Page Layout assignments on the Location Object
  6. +
  7. Update Page Layout assignments on the Contact Object (optional)
  8. +
  9. Update Page Layout assignments on the Account Object (optional)
  10. +
  11. Load Breeds Data
  12. +
  13. Setup your Locations
  14. +
  15. Review and check Flows
  16. +
  17. Create a Account record for your Shelter which will be used as the default Animal Owner for animals coming into + the shelter
  18. +
  19. Review and check Custom Settings
  20. +
+
+
+
+
+
From f7fbf0621d4e671a2b92175d61c7c3daaf44f089 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Thu, 16 Jan 2025 14:39:46 +0000 Subject: [PATCH 5/9] Updated existing Adoption and Entry Flow --- ...ter_Contact_Record_Page.flexipage-meta.xml | 16 +- ...l_Adoption_Update_Automation.flow-meta.xml | 140 +++++- .../Animal_Animal_Entry_Flow.flow-meta.xml | 413 +++++++++++++++--- ...Default_Shelter_Name_Subflow.flow-meta.xml | 100 +++++ ...imal_Relationships.globalValueSet-meta.xml | 5 + .../Human_Relationship.recordType-meta.xml | 4 + 6 files changed, 584 insertions(+), 94 deletions(-) create mode 100644 force-app/main/default/flows/Animal_Default_Shelter_Name_Subflow.flow-meta.xml diff --git a/force-app/main/default/flexipages/Animal_Shelter_Contact_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Shelter_Contact_Record_Page.flexipage-meta.xml index 8be775d8..5ca51222 100644 --- a/force-app/main/default/flexipages/Animal_Shelter_Contact_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Shelter_Contact_Record_Page.flexipage-meta.xml @@ -235,6 +235,11 @@ adminFilters + + + Active__c|EQUALS|true + + maxRecordsToDisplay @@ -246,7 +251,7 @@ relatedListApiName - Animals__r + Animal_Relationships__r relatedListDisplayType @@ -259,19 +264,16 @@ Animal_Name__c - TypeFromBreeds__c - - - Species__c + NAME - NAME + Relationship_Types__c relatedListLabel - Related Animals + Animal Relationships showActionBar diff --git a/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml b/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml index b99274a0..7da94d72 100644 --- a/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Adoption_Update_Automation.flow-meta.xml @@ -1,8 +1,7 @@ 60.0 - [Animal Shelter] - When Adoption Status = Adopted: Update Contact Flag, Clear - current and create new Movement record, update Animal status and details + [Animal Shelter] - When Adoption Status = Adopted: Update Contact Flag, Clear current and create new Movement record, update Animal status and details. Create Relationship record Default formulaAdoptionDate @@ -44,7 +43,7 @@ Create_New_Movement_Record 176 - 755 + 863 Close_Animal_Action_Records @@ -75,12 +74,59 @@ Movement__c true + + Create_new_Relationship_record_for_Owner + + 176 + 1295 + + Update_Adoption_Record + + + Active__c + + true + + + + Animal__c + + $Record.Animal__r.Id + + + + Contact__c + + $Record.Primary_Contact__r.Id + + + + RecordTypeId + + Get_Relationship_Record_Type_ID.returnedRecordTypeId + + + + Relationship_Types__c + + Owner + + + + Start_Date__c + + $Flow.CurrentDate + + + Animal_Relationship__c + true + Get the Current Movement Record for the Animal Get_Current_Movement_Record 176 - 431 + 539 false Clean_Up_Location_Record @@ -109,7 +155,7 @@ Clean_Up_Location_Record 176 - 539 + 647 Close_Current_Movement_Record @@ -140,7 +186,7 @@ Close_Animal_Action_Records 176 - 863 + 971 Update_Animal_Record @@ -197,7 +243,7 @@ Close_Current_Movement_Record 176 - 647 + 755 Create_New_Movement_Record @@ -224,12 +270,11 @@ Movement__c - Sets the "Is An Adopter" Flag on the associated Contact to indicate - they are an Adopter + Sets the "Is An Adopter" Flag on the associated Contact to indicate they are an Adopter Set_Adopter_Flag_on_Contact_to_True 176 - 323 + 431 Get_Current_Movement_Record @@ -254,7 +299,7 @@ Update_Adoption_Record 176 - 1079 + 1403 Date_Collected__c @@ -274,9 +319,9 @@ Update_Animal_Record 176 - 971 + 1079 - Update_Adoption_Record + Update_any_Existing_Owner_Relationship_Record and @@ -298,19 +343,57 @@ Adopted - See Adoption Record + Animal__c + + + Update_any_Existing_Owner_Relationship_Record + + 176 + 1187 + + Create_new_Relationship_record_for_Owner + + and + + Animal__c + EqualTo + + $Record.Animal__r.Id + + + + Active__c + EqualTo + + true + + + + Relationship_Types__c + EqualTo + + Owner + + - Previous_Current_Owner__c + Active__c - $Record.Primary_Contact__r.Id + false - Animal__c + + End_Date__c + + $Flow.CurrentDate + + + Animal_Relationship__c 50 0 - Set_Adopter_Flag_on_Contact_to_True + Get_Relationship_Record_Type_ID true and @@ -326,4 +409,27 @@ RecordAfterSave Active + + Get_Relationship_Record_Type_ID + + 176 + 323 + + Set_Adopter_Flag_on_Contact_to_True + + Animal_RecordType_Subflow + + developerName + + Human_Relationship + + + + sObjectName + + animalshelters__Animal_Relationship__c + + + true + diff --git a/force-app/main/default/flows/Animal_Animal_Entry_Flow.flow-meta.xml b/force-app/main/default/flows/Animal_Animal_Entry_Flow.flow-meta.xml index 1a1087aa..d7bc3bb0 100644 --- a/force-app/main/default/flows/Animal_Animal_Entry_Flow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Animal_Entry_Flow.flow-meta.xml @@ -1,11 +1,59 @@ 62.0 + + Add_Contact_Finder_Relationship_to_Collection + + 490 + 1214 + + newRelationships + Add + + newRelationship + + + + Get_Default_Shelter + + + + Add_Contact_Relationship_to_Collection + + 138 + 1214 + + newRelationships + Add + + newRelationship + + + + Create_Relationship_records + + + + Add_Default_Shelter_Relationship_to_Collection + + 578 + 1646 + + newRelationships + Add + + newRelationship + + + + Create_Relationship_records + + Additional_Assignment_Data - 534 - 2138 + 50 + 2846 newAlert.Animal__c Assign @@ -28,8 +76,8 @@ Assigns additional and mandatory animal details Assign_Additional_Animal_Details - 798 - 242 + 1040 + 350 newAnimal.Date_of_Arrival__c Assign @@ -58,8 +106,8 @@ Clear_Animal_Collection - 666 - 2702 + 182 + 3410 newAnimal Assign @@ -72,6 +120,169 @@ start_Screen + + Create a new Relationship record and set the created contact as the Finder + Create_Relationship_for_Contact_as_Finder + + 490 + 1106 + + newRelationship.Animal__c + Assign + + newAnimal.Id + + + + newRelationship.Contact__c + Assign + + newContact.Id + + + + newRelationship.Active__c + Assign + + true + + + + newRelationship.Start_Date__c + Assign + + $Flow.CurrentDate + + + + newRelationship.Relationship_Types__c + Assign + + Finder + + + + newRelationship.RecordTypeId + Assign + + Get_Human_Relationship_RecordType_Id.returnedRecordTypeId + + + + Add_Contact_Finder_Relationship_to_Collection + + + + Create a new Relationship record with Contact as Owner + Create_Relationship_for_Contact_as_Owner + + 138 + 1106 + + newRelationship.Animal__c + Assign + + newAnimal.Id + + + + newRelationship.Contact__c + Assign + + newContact.Id + + + + newRelationship.Active__c + Assign + + true + + + + newRelationship.Start_Date__c + Assign + + $Flow.CurrentDate + + + + newRelationship.Relationship_Types__c + Assign + + Owner + + + + newRelationship.RecordTypeId + Assign + + Get_Human_Relationship_RecordType_Id.returnedRecordTypeId + + + + Add_Contact_Relationship_to_Collection + + + + Create a relationship record and sets the Default Organisation as the Owner + Create_Relationship_for_Default_Shelter_as_Owner + + 578 + 1538 + + newRelationship.Animal__c + Assign + + newAnimal.Id + + + + newRelationship.Active__c + Assign + + true + + + + newRelationship.Start_Date__c + Assign + + $Flow.CurrentDate + + + + newRelationship.Relationship_Types__c + Assign + + Owner + + + + newRelationship.Organisation__c + Assign + + Get_Default_Shelter.accountID + + + + newRelationship.RecordTypeId + Assign + + Get_Human_Relationship_RecordType_Id.returnedRecordTypeId + + + + newRelationship.Contact__c + Assign + + + + + + Add_Default_Shelter_Relationship_to_Collection + + DifferentAnimalType Yes - Different characteristics @@ -99,8 +310,8 @@ Assign_Location - 798 - 1322 + 314 + 2030 Create_Assessment_Record @@ -124,8 +335,8 @@ Create_Alert_Record - 798 - 1922 + 314 + 2630 Create_Additional_Animal_Screen @@ -150,8 +361,8 @@ Does the User want to create another Animal entry Create_another_Animal_entry_record - 798 - 2594 + 314 + 3302 Default Yes_Duplicate @@ -200,8 +411,8 @@ Create_Assessment_Record - 798 - 1622 + 314 + 2330 Create_Alert_Record @@ -225,10 +436,11 @@ Create_Contact - 798 - 458 + 1040 + 566 - Assign_Location + true + Get_Default_Shelter Default Outcome @@ -252,9 +464,9 @@ Is_Contact_Owner 314 - 890 + 998 - Assign_Location + Create_Relationship_for_Contact_as_Finder Default Outcome @@ -268,11 +480,37 @@ - Update_Animal_Record_with_Contact + Create_Relationship_for_Contact_as_Owner + + If the Default Shelter Name is null then do not set + Is_Default_Shelter_Null + + 490 + 1430 + + Create_Relationship_for_Default_Shelter_as_Owner + + Is Set + + Yes_is_Null + and + + Get_Default_Shelter.accountID + IsNull + + true + + + + Create_Relationship_records + + + + [Animal Shelters] - Screen flow providing an Animal Entry wizard. Allows creation of Animal, Location assignment, Assessment, Contact and Alerts. Default @@ -309,8 +547,8 @@ Create_Alert - 534 - 2246 + 50 + 2954 Create_Additional_Animal_Screen @@ -324,8 +562,8 @@ Create the new Animal Record Create_New_Animal_Record - 798 - 350 + 1040 + 458 Create_Contact @@ -339,7 +577,7 @@ Create_New_Contact 314 - 782 + 890 Is_Contact_Owner @@ -349,11 +587,25 @@ newContact + + Create_Relationship_records + + 314 + 1922 + + Assign_Location + + + true + Error_Screen + + newRelationships + Is_Person_Accounts_enabled 314 - 566 + 674 false Contact_Details_Screen @@ -381,40 +633,11 @@ FieldDefinition true - - Update animal record with the Contact just created - Update_Animal_Record_with_Contact - - 50 - 998 - - Assign_Location - - - true - Error_Screen - - and - - Id - EqualTo - - newAnimal.Id - - - - Previous_Current_Owner__c - - newContact.Id - - - Animal__c - Animal_Create_Alert - 534 - 2030 + 50 + 2738 false true false @@ -487,7 +710,7 @@ Contact_Details_Screen 314 - 674 + 782 false true false @@ -626,8 +849,8 @@ Create_Additional_Animal_Screen - 798 - 2486 + 314 + 3194 false true false @@ -651,8 +874,8 @@ Error_Screen - 1458 - 458 + 2030 + 566 false true false @@ -667,8 +890,8 @@ start_Screen - 798 - 134 + 1040 + 242 false true false @@ -879,10 +1102,10 @@ true - 672 + 914 0 - start_Screen + Get_Human_Relationship_RecordType_Id Active @@ -890,8 +1113,8 @@ Call Create new Assessment Screen Flow and pass Record Id of new Animal Create_New_Assessment - 666 - 1730 + 182 + 2438 Create_Alert_Record @@ -903,12 +1126,46 @@ + + Get_Default_Shelter + + 490 + 1322 + + Is_Default_Shelter_Null + + Animal_Default_Shelter_Name_Subflow + true + + + Get_Human_Relationship_RecordType_Id + + 1040 + 134 + + start_Screen + + Animal_RecordType_Subflow + + developerName + + Human_Relationship + + + + sObjectName + + animalshelters__Animal_Relationship__c + + + true + Call Movement Process Screen Flow and pass Record Id of new Animal Movement_Process_Screen_Flow - 666 - 1430 + 182 + 2138 Create_Assessment_Record @@ -952,4 +1209,20 @@ false Contact + + newRelationship + SObject + false + false + false + Animal_Relationship__c + + + newRelationships + SObject + true + false + false + Animal_Relationship__c + diff --git a/force-app/main/default/flows/Animal_Default_Shelter_Name_Subflow.flow-meta.xml b/force-app/main/default/flows/Animal_Default_Shelter_Name_Subflow.flow-meta.xml new file mode 100644 index 00000000..7e87b008 --- /dev/null +++ b/force-app/main/default/flows/Animal_Default_Shelter_Name_Subflow.flow-meta.xml @@ -0,0 +1,100 @@ + + + 62.0 + + Assign_Account_ID_to_Output_Variable + + 50 + 350 + + accountID + Assign + + Get_Account_Based_on_Account_Name.Id + + + + + Check Custom Setting to see if Default Shelter Name is Set + Is_Default_Shelter_Name_Set + + 182 + 134 + No Name Set + + Yes_Name_Set + and + + $Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Default_Shelter_Name__c + IsNull + + false + + + + Get_Account_Based_on_Account_Name + + + + + [Animal Shelter] - Subflow to check and get the Account based on the Default Shelter Name setting. Returns Account Id + Default + Animal - Default Shelter Name - Subflow {!$Flow.CurrentDateTime} + true + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Get_Account_Based_on_Account_Name + + 50 + 242 + false + + Assign_Account_ID_to_Output_Variable + + and + + Name + EqualTo + + $Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Default_Shelter_Name__c + + + true + Account + true + + + 56 + 0 + + Is_Default_Shelter_Name_Set + + + Active + + accountID + String + false + false + true + + diff --git a/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml b/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml index 2acb0bf1..d4b67f4d 100644 --- a/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml +++ b/force-app/main/default/globalValueSets/Animal_Relationships.globalValueSet-meta.xml @@ -35,6 +35,11 @@ false + + Finder + false + + [Animal Shelter] List of Relationships between Animal-to-Animal and Contact-to-Animal Animal Relationships false diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml index df762d98..6e27a5a5 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml @@ -14,6 +14,10 @@ Carer false + + Finder + false + Foster false From de82601186823a3bb7b3ca57e725741400b40a6b Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Thu, 16 Jan 2025 16:38:51 +0000 Subject: [PATCH 6/9] Nes Flows to Clear Foster Relationships --- ..._Foster_Relationship_SubFlow.flow-meta.xml | 222 ++++++++++++++++++ .../Animal_Movement_Process.flow-meta.xml | 24 +- .../Animal_Movement_SubFlow.flow-meta.xml | 34 ++- ...ow_Clear_Foster_Relationship.flow-meta.xml | 106 +++++++++ ...helter Contact Page Layout.layout-meta.xml | 51 ++-- 5 files changed, 397 insertions(+), 40 deletions(-) create mode 100644 force-app/main/default/flows/Animal_Foster_Relationship_SubFlow.flow-meta.xml create mode 100644 force-app/main/default/flows/Animal_Subflow_Clear_Foster_Relationship.flow-meta.xml diff --git a/force-app/main/default/flows/Animal_Foster_Relationship_SubFlow.flow-meta.xml b/force-app/main/default/flows/Animal_Foster_Relationship_SubFlow.flow-meta.xml new file mode 100644 index 00000000..c8fca8e7 --- /dev/null +++ b/force-app/main/default/flows/Animal_Foster_Relationship_SubFlow.flow-meta.xml @@ -0,0 +1,222 @@ + + + 62.0 + + Existing_Foster_Relationship + + 182 + 458 + + Create_New_Foster_Relationship + + None Existing + + Yes_Existing + and + + Get_Existing_Foster_Relationship_records + IsNull + + false + + + + Updated_Existing_Foster_Relationship + + + + + + Is_Movement_Type_Fostered + + 336 + 242 + No + + Yes + and + + movementRecord.Type__c + EqualTo + + Fostered + + + + Get_Existing_Foster_Relationship_records + + + + + [Animal Shelter] - Subflow - Creates a new Foster Relationship record, and updates existing + Default + Animal - Foster Relationship SubFlow {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_New_Foster_Relationship + + 182 + 758 + + Active__c + + true + + + + Animal__c + + movementRecord.Animal__r.Id + + + + Contact__c + + movementRecord.Location__r.Foster_Contact__r.Id + + + + RecordTypeId + + Get_Relationship_RecordType.returnedRecordTypeId + + + + Relationship_Types__c + + Foster + + + + Start_Date__c + + $Flow.CurrentDate + + + Animal_Relationship__c + true + + + Get_Existing_Foster_Relationship_records + + 182 + 350 + false + + Existing_Foster_Relationship + + and + + Animal__c + EqualTo + + movementRecord.Animal__r.Id + + + + Relationship_Types__c + EqualTo + + Foster + + + + Active__c + EqualTo + + true + + + true + Animal_Relationship__c + true + + + Updated_Existing_Foster_Relationship + + 50 + 566 + + Create_New_Foster_Relationship + + and + + Id + EqualTo + + Get_Existing_Foster_Relationship_records.Id + + + + Active__c + + false + + + + End_Date__c + + $Flow.CurrentDate + + + Animal_Relationship__c + + + 210 + 0 + + Get_Relationship_RecordType + + + Active + + Get_Relationship_RecordType + + 336 + 134 + + Is_Movement_Type_Fostered + + Animal_RecordType_Subflow + + developerName + + Human_Relationship + + + + sObjectName + + animalshelters__Animal_Relationship__c + + + true + + + movementRecord + SObject + false + true + false + Movement__c + + diff --git a/force-app/main/default/flows/Animal_Movement_Process.flow-meta.xml b/force-app/main/default/flows/Animal_Movement_Process.flow-meta.xml index b6620a69..53efc36f 100755 --- a/force-app/main/default/flows/Animal_Movement_Process.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Movement_Process.flow-meta.xml @@ -594,7 +594,7 @@ 490 1730 - Reset_Location_Status + Clear_Foster_Relationship true @@ -626,7 +626,7 @@ Reset_Location_Status 490 - 1838 + 1946 CreateMovementRecord @@ -880,7 +880,7 @@ Movement_Complete 1502 - 2438 + 2546 false true false @@ -956,11 +956,27 @@ Active + + Clear_Foster_Relationship + + 490 + 1838 + + Reset_Location_Status + + Animal_Subflow_Clear_Foster_Relationship + + movementRecord + + Get_Current_Movement_Record + + + CreateMovementRecord 1502 - 2330 + 2438 Movement_Complete diff --git a/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml b/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml index 4c353c3b..30ce5a7d 100755 --- a/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Movement_SubFlow.flow-meta.xml @@ -4,7 +4,7 @@ Error_Email 578 - 758 + 866 emailSimple emailSimple CurrentTransaction @@ -101,7 +101,7 @@ Set_Output_Variable 182 - 1058 + 1166 newMovementRecordId Assign @@ -147,13 +147,13 @@ Generate_Movement_Task 182 - 1166 + 1274 No Yes and - $Setup.Animal_Shelter_Settings__c.Enable_Movement_Tasks__c + $Setup.animalshelters__Animal_Shelter_Settings__c.animalshelters__Enable_Movement_Tasks__c EqualTo true @@ -194,7 +194,7 @@ Update_Animal_Location_Fields 182 - 758 + 866 Set_Output_Variable @@ -254,7 +254,7 @@ 182 542 - Get_Newly_Created_Movement_Record + Create_Foster_Relationship_if_required true @@ -266,7 +266,7 @@ Get_Newly_Created_Movement_Record 182 - 650 + 758 false Update_Animal_Location_Fields @@ -290,7 +290,7 @@ Update_Animal_Location_Status 50 - 866 + 974 Set_Output_Variable @@ -324,11 +324,27 @@ Active + + Create_Foster_Relationship_if_required + + 182 + 650 + + Get_Newly_Created_Movement_Record + + Animal_Foster_Relationship_SubFlow + + movementRecord + + varNewMovementRecord + + + Create_Movement_Task 50 - 1274 + 1382 Animal_Generate_Tasks_Subflow animalRecordId diff --git a/force-app/main/default/flows/Animal_Subflow_Clear_Foster_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_Subflow_Clear_Foster_Relationship.flow-meta.xml new file mode 100644 index 00000000..d5285398 --- /dev/null +++ b/force-app/main/default/flows/Animal_Subflow_Clear_Foster_Relationship.flow-meta.xml @@ -0,0 +1,106 @@ + + + 62.0 + + Was_Movement_a_Foster_Type + + 182 + 134 + No + + Yes + and + + movementRecord.Type__c + EqualTo + + Fostered + + + + Update_Related_Relationship_record + + + + + [Animal Shelter] Subflow - Clears the Foster Relationship when Animal moves from a Foster + Default + Animal - Subflow - Clear Foster Relationship {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Update_Related_Relationship_record + + 50 + 242 + and + + Animal__c + EqualTo + + movementRecord.Animal__r.Id + + + + Active__c + EqualTo + + true + + + + Relationship_Types__c + EqualTo + + Foster + + + + Active__c + + false + + + + End_Date__c + + $Flow.CurrentDate + + + Animal_Relationship__c + + + 56 + 0 + + Was_Movement_a_Foster_Type + + + Active + + movementRecord + SObject + false + true + false + Movement__c + + diff --git a/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml b/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml index bb31dc53..e3e3e7ae 100644 --- a/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml +++ b/force-app/main/default/layouts/Contact-Animal Shelter Contact Page Layout.layout-meta.xml @@ -2,7 +2,8 @@ CreateCallList CreateSurveyInvitation - RequestUseSfdc + DataDotComClean + OpenSlackRecordChannel Submit XClean @@ -171,6 +172,21 @@ Record + + Contact.New_Adopter_Profile + QuickAction + 0 + + + NewTask + QuickAction + 1 + + + LogACall + QuickAction + 2 + NewCase QuickAction @@ -206,6 +222,11 @@ StandardButton 9 + + SendSurveyInvitation + StandardButton + 10 + Clone StandardButton @@ -261,26 +282,6 @@ ProductivityAction 21 - - SendSurveyInvitation - StandardButton - 10 - - - Contact.New_Adopter_Profile - QuickAction - 0 - - - NewTask - QuickAction - 1 - - - LogACall - QuickAction - 2 - @@ -324,11 +325,7 @@ NAME - Animal_Name__c - Type__c - Breed__c - Animal_Status__c - Animal__c.Previous_Current_Owner__c + Animal_Relationship__c.Contact__c OPPORTUNITY.NAME @@ -392,7 +389,7 @@ false false - 00h7d0000011vwc + 00hKU000000kgZ5 4 0 Default From 4895e5c176797532323faf30a6971b61f3064053 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Fri, 17 Jan 2025 11:34:05 +0000 Subject: [PATCH 7/9] Update to Relationship Included User lookup Updated flows Updated Layouts Added Quick Action --- .../Animal_Record_Page.flexipage-meta.xml | 3 + ...elationship_Record_Page.flexipage-meta.xml | 236 +++++++++++++++--- ...ciprocal_Animal_Relationship.flow-meta.xml | 23 +- ...uman_Relationship_Management.flow-meta.xml | 153 +++++++----- ...Animal Relationship Layout.layout-meta.xml | 36 +-- ...-Human Relationship Layout.layout-meta.xml | 147 +++++++++++ .../fields/Internal_User__c.field-meta.xml | 13 + .../fields/Name__c.field-meta.xml | 14 +- .../fields/Record_Type_Name__c.field-meta.xml | 14 ++ ...ive_Animal_Relationships.listView-meta.xml | 24 ++ ...tive_Human_Relationships.listView-meta.xml | 26 ++ .../listViews/All.listView-meta.xml | 11 + .../Human_Relationship.recordType-meta.xml | 2 +- ...s_are_not_being_us.validationRule-meta.xml | 13 - ...ookup_is_populated.validationRule-meta.xml | 15 ++ ...ew_Human_Relationship.quickAction-meta.xml | 7 + 16 files changed, 591 insertions(+), 146 deletions(-) create mode 100644 force-app/main/default/layouts/Animal_Relationship__c-Human Relationship Layout.layout-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Internal_User__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/fields/Record_Type_Name__c.field-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Animal_Relationships.listView-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Human_Relationships.listView-meta.xml delete mode 100644 force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml create mode 100644 force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_only_one_lookup_is_populated.validationRule-meta.xml create mode 100644 force-app/main/default/quickActions/Animal__c.New_Human_Relationship.quickAction-meta.xml diff --git a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml index 4be113c4..e4add4c6 100644 --- a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml @@ -77,6 +77,9 @@ animalshelters__Animal__c.Multi_Animal_Clone + + animalshelters__Animal__c.New_Human_Relationship + Global.NewEvent diff --git a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml index 934e95bf..4f072bf6 100644 --- a/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Relationship_Record_Page.flexipage-meta.xml @@ -75,8 +75,12 @@ - Record.Animal_Name__c - RecordAnimal_Name__cField + + uiBehavior + none + + Record.Relationship_Types__c + Recordanimalshelters__Relationship_Types__cField @@ -85,69 +89,155 @@ uiBehavior none - Record.Animal__c - RecordAnimal__cField + Record.Start_Date__c + Recordanimalshelters__Start_Date__cField + Facet-68662187-8f71-47f2-86b5-7b3da55118e2 + Facet + + uiBehavior none - Record.Status__c - RecordStatus__cField + Record.Active__c + Recordanimalshelters__Active__cField - Record.External_Id__c - Recordanimalshelters__External_Id__cField + + uiBehavior + none + + Record.End_Date__c + Recordanimalshelters__End_Date__cField + Facet-29733fd2-1330-4d06-9dac-b2a3c3c27138 + Facet + + - - Record.Contact__c - Recordanimalshelters__Contact__cField - + + + body + Facet-68662187-8f71-47f2-86b5-7b3da55118e2 + + flexipage:column + flexipage_column7 + + + + + body + Facet-29733fd2-1330-4d06-9dac-b2a3c3c27138 + + flexipage:column + flexipage_column8 + + + Facet-bad8d788-413a-4d12-a395-cc0a5643dd47 + Facet + + - Record.Relationship_Types__c - Recordanimalshelters__Relationship_Types__cField + + uiBehavior + none + + Record.Animal__c + RecordAnimal__cField - Record.Name__c - Recordanimalshelters__Contact_Name__cField + + uiBehavior + none + + Record.Animal_Name__c + RecordAnimal_Name__cField + Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 + Facet + + - Record.Organisation__c - Recordanimalshelters__Organisation__cField + + uiBehavior + none + + Record.Related_Animal__c + RecordRelated_Animal__cField - Record.Active__c - Recordanimalshelters__Active__cField + + uiBehavior + readonly + + Record.Related_Animal_Name__c + RecordRelated_Animal_Name__cField + Facet-bffbd6d8-1681-499f-94e2-838fb81b801d + Facet + + + + + + body + Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 + + flexipage:column + flexipage_column + + + + + + body + Facet-bffbd6d8-1681-499f-94e2-838fb81b801d + + flexipage:column + flexipage_column2 + + + Facet-cc784015-b845-40fc-9480-dd01c309927c + Facet + + - Record.Start_Date__c - Recordanimalshelters__Start_Date__cField + + uiBehavior + none + + Record.Contact__c + Recordanimalshelters__Contact__cField - Record.End_Date__c - Recordanimalshelters__End_Date__cField + + uiBehavior + none + + Record.Organisation__c + Recordanimalshelters__Organisation__cField - Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 + Facet-15b2d7d2-7559-4c07-ac34-e029607dc150 Facet @@ -155,10 +245,10 @@ uiBehavior - readonly + none - Record.Related_Animal_Name__c - RecordRelated_Animal_Name__cField + Record.Internal_User__c + Recordanimalshelters__Internal_User__cField @@ -167,11 +257,11 @@ uiBehavior none - Record.Related_Animal__c - RecordRelated_Animal__cField + Record.Name__c + Recordanimalshelters__Contact_Name__cField - Facet-bffbd6d8-1681-499f-94e2-838fb81b801d + Facet-067149a4-42e4-47bc-9e74-8c0e1de9a678 Facet @@ -179,38 +269,92 @@ body - Facet-e0a8926f-51de-44d3-b00c-5e840edb0236 + Facet-15b2d7d2-7559-4c07-ac34-e029607dc150 flexipage:column - flexipage_column + flexipage_column5 body - Facet-bffbd6d8-1681-499f-94e2-838fb81b801d + Facet-067149a4-42e4-47bc-9e74-8c0e1de9a678 flexipage:column - flexipage_column2 + flexipage_column6 - Facet-cc784015-b845-40fc-9480-dd01c309927c + Facet-bf2cbb94-f131-43fe-a564-cd8397bc31fb Facet + + + + columns + Facet-bad8d788-413a-4d12-a395-cc0a5643dd47 + + + horizontalAlignment + false + + + label + Details + + flexipage:fieldSection + flexipage_fieldSection4 + + columns Facet-cc784015-b845-40fc-9480-dd01c309927c + + horizontalAlignment + false + label - Information + Animal Relationship flexipage:fieldSection flexipage_fieldSection + + + {!Record.RecordType.Name} + EQUAL + Animal Relationship + + + + + + + + columns + Facet-bf2cbb94-f131-43fe-a564-cd8397bc31fb + + + horizontalAlignment + false + + + label + Human Relationship + + flexipage:fieldSection + flexipage_fieldSection3 + + + {!Record.RecordType.Name} + EQUAL + Human Relationship + + Facet-e395cd63-6440-44e2-b040-771851ca1668 @@ -237,6 +381,16 @@ RecordOwnerIdField + + + + uiBehavior + none + + Record.External_Id__c + Recordanimalshelters__External_Id__cField + + Facet-aa9b5971-cc8d-49ad-b1b4-e3300b9f3712 Facet @@ -295,6 +449,10 @@ columns Facet-2b2554de-fa19-482d-9dc6-636f28525d51 + + horizontalAlignment + false + label System Information @@ -406,6 +564,10 @@ + + showLegacyActivityComposer + false + runtime_sales_activities:activityPanel runtime_sales_activities_activityPanel diff --git a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml index 562ed181..8e5931ee 100644 --- a/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Create_Reciprocal_Animal_Relationship.flow-meta.xml @@ -31,6 +31,12 @@ 176 539 + + Active__c + + true + + Animal__c @@ -56,9 +62,15 @@ - Status__c + Relationship_Types__c + + $Record.Relationship_Types__c + + + + Start_Date__c - Current + $Record.Start_Date__c Animal_Relationship__c @@ -102,6 +114,13 @@ false + + Record_Type_Name__c + EqualTo + + Animal Relationship + + Animal_Relationship__c Create RecordAfterSave diff --git a/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml b/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml index 13d169d4..5627a496 100644 --- a/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml +++ b/force-app/main/default/flows/Animal_Human_Relationship_Management.flow-meta.xml @@ -18,7 +18,7 @@ newRelationship.Animal__c Assign - animalRecord.Id + recordId.Id @@ -78,6 +78,30 @@ Update_Current_Relationship + + Contact + Contact + String + + Contact + + + + InternalUser + Internal User + String + + Internal User + + + + Organisation + Organisation + String + + Organisation + + Decides whether a Row has been selected for Update Has_a_row_been_selected @@ -104,7 +128,7 @@ - [Animal Shelter] - Screen flow to manage the relationships between Contacts/Organisations (Accounts) and Animals + [Animal Shelter] - Screen flow to manage the relationships between Contacts/Organisations (Accounts)/Internal Users and Animals Default Animal - Human Relationship Management {!$Flow.CurrentDateTime} true @@ -157,7 +181,7 @@ Animal__c EqualTo - animalRecord.Id + recordId.Id @@ -211,7 +235,7 @@ Region Animal_Relationships_Screen_Text - <p>Select a existing relationship to update, and choose the Contact or Organisation and relationship.</p><p>Or create a new relationship</p> + <p>Select a existing relationship to update, and choose the Contact, Organisation or Internal User and relationship.</p><p>Or create a new relationship</p> DisplayText @@ -297,60 +321,63 @@ SectionWithoutHeader - Animal_Relationships_Screen_Section3 - RegionContainer - - Animal_Relationships_Screen_Section3_Column1 - Region - - ObjectProvided - UseStoredValues - false - newRelationship.Contact__c - - - width - - 4 - - - false - - - Animal_Relationships_Screen_Section3_Column2 - Region - - Animal_Relationships_Screen_Text_2 - <p style="text-align: center;"><strong style="font-size: 24px;">Or</strong></p> - DisplayText - - - width - - 4 - - - false - - - Animal_Relationships_Screen_Section3_Column3 - Region - - ObjectProvided - UseStoredValues - false - newRelationship.Organisation__c - - - width - - 4 - - - false - + Connected_Human_Organisation + Contact + Organisation + InternalUser + String + Connected Human/Organisation + RadioButtons + UseStoredValues + true + + + ObjectProvided + UseStoredValues false - SectionWithoutHeader + newRelationship.Contact__c + + and + + Connected_Human_Organisation + EqualTo + + Contact + + + + + + ObjectProvided + UseStoredValues + false + newRelationship.Organisation__c + + and + + Connected_Human_Organisation + EqualTo + + Organisation + + + + + + ObjectProvided + UseStoredValues + false + newRelationship.Internal_User__c + + and + + Connected_Human_Organisation + EqualTo + + InternalUser + + + ObjectProvided @@ -410,20 +437,20 @@ true - animalRecord + newRelationship SObject false - true + false false - Animal__c + Animal_Relationship__c - newRelationship + recordId SObject false - false + true false - Animal_Relationship__c + Animal__c selectedRow diff --git a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml index 66d51854..6896aa67 100644 --- a/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml +++ b/force-app/main/default/layouts/Animal_Relationship__c-Animal Relationship Layout.layout-meta.xml @@ -6,31 +6,23 @@ true - - Readonly - Animal_Name__c - Edit - Animal__c + Relationship_Types__c Edit - Relationship_Types__c + Start_Date__c - - Readonly - Related_Animal_Name__c - Edit - Related_Animal__c + Active__c Edit - Status__c + End_Date__c @@ -39,33 +31,25 @@ true true true - + Edit - Contact__c + Animal__c Readonly - Name__c - - - Edit - Organisation__c + Animal_Name__c Edit - Active__c - - - Edit - Start_Date__c + Related_Animal__c - Edit - End_Date__c + Readonly + Related_Animal_Name__c diff --git a/force-app/main/default/layouts/Animal_Relationship__c-Human Relationship Layout.layout-meta.xml b/force-app/main/default/layouts/Animal_Relationship__c-Human Relationship Layout.layout-meta.xml new file mode 100644 index 00000000..75cbca12 --- /dev/null +++ b/force-app/main/default/layouts/Animal_Relationship__c-Human Relationship Layout.layout-meta.xml @@ -0,0 +1,147 @@ + + + + false + false + true + + + + Edit + Relationship_Types__c + + + Edit + Start_Date__c + + + + + Edit + Active__c + + + Edit + End_Date__c + + + + + + true + true + true + + + + Edit + Animal__c + + + + + Readonly + Animal_Name__c + + + + + + true + true + true + + + + Edit + Contact__c + + + Readonly + Name__c + + + + + Edit + Organisation__c + + + Edit + Internal_User__c + + + + + + false + false + true + + + + Readonly + CreatedById + + + Readonly + Name + + + Edit + External_Id__c + + + + + Readonly + LastModifiedById + + + Edit + OwnerId + + + + + + true + false + true + + + + + + + + TASK.SUBJECT + TASK.WHO_NAME + ACTIVITY.TASK + TASK.DUE_DATE + TASK.STATUS + TASK.PRIORITY + CORE.USERS.FULL_NAME + RelatedActivityList + + + TASK.SUBJECT + TASK.WHO_NAME + ACTIVITY.TASK + TASK.DUE_DATE + CORE.USERS.FULL_NAME + TASK.LAST_UPDATE + RelatedHistoryList + + false + false + false + false + false + + 00hKU000000mjYI + 4 + 0 + Default + + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Internal_User__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Internal_User__c.field-meta.xml new file mode 100644 index 00000000..5651b1ff --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Internal_User__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Internal_User__c + SetNull + false + + User + Animal_Relationships + false + false + false + Lookup + diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml index 8eae206d..16e6bd7a 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Name__c.field-meta.xml @@ -3,11 +3,17 @@ Name__c false IF( - NOT(ISBLANK( Contact__c )), Contact__r.FirstName & " " & Contact__r.LastName, - + NOT(ISBLANK(Contact__c)), + Contact__r.FirstName & " " & Contact__r.LastName, IF( - NOT(ISBLANK( Organisation__c )), Organisation__r.Name, " " - ) + NOT(ISBLANK(Organisation__c)), + Organisation__r.Name, + IF( + NOT(ISBLANK( Internal_User__c )), + Internal_User__r.FirstName & " " & Internal_User__r.LastName , + "" + ) + ) ) BlankAsZero diff --git a/force-app/main/default/objects/Animal_Relationship__c/fields/Record_Type_Name__c.field-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/fields/Record_Type_Name__c.field-meta.xml new file mode 100644 index 00000000..de961bf2 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/fields/Record_Type_Name__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Record_Type_Name__c + INTERNAL Use Only + false + RecordType.Name + BlankAsZero + + false + false + false + Text + false + diff --git a/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Animal_Relationships.listView-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Animal_Relationships.listView-meta.xml new file mode 100644 index 00000000..34a020b9 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Animal_Relationships.listView-meta.xml @@ -0,0 +1,24 @@ + + + Active_Animal_Relationships + NAME + Animal__c + Animal_Name__c + Related_Animal__c + Related_Animal_Name__c + Relationship_Types__c + Active__c + Start_Date__c + Everything + + Active__c + equals + 1 + + + RECORDTYPE + equals + Animal_Relationship__c.Animal_Relationship + + + diff --git a/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Human_Relationships.listView-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Human_Relationships.listView-meta.xml new file mode 100644 index 00000000..7871aa4c --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/listViews/Active_Human_Relationships.listView-meta.xml @@ -0,0 +1,26 @@ + + + Active_Human_Relationships + NAME + Animal__c + Animal_Name__c + Contact__c + Internal_User__c + Name__c + Organisation__c + Relationship_Types__c + Active__c + Start_Date__c + Everything + + Active__c + equals + 1 + + + RECORDTYPE + equals + Animal_Relationship__c.Human_Relationship + + + diff --git a/force-app/main/default/objects/Animal_Relationship__c/listViews/All.listView-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/listViews/All.listView-meta.xml index d5058512..90e3fe07 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/listViews/All.listView-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/listViews/All.listView-meta.xml @@ -1,6 +1,17 @@ All + NAME + Active__c + Animal__c + Animal_Name__c + Record_Created__c + RECORDTYPE + Related_Animal__c + Related_Animal_Name__c + Relationship_Types__c + Start_Date__c + Record_Type_Name__c Everything diff --git a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml index 6e27a5a5..67295e8d 100644 --- a/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml +++ b/force-app/main/default/objects/Animal_Relationship__c/recordTypes/Human_Relationship.recordType-meta.xml @@ -24,7 +24,7 @@ Owner - true + false Trainer diff --git a/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml deleted file mode 100644 index 096c05bb..00000000 --- a/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_both_Lookups_are_not_being_us.validationRule-meta.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - Check_that_both_Lookups_are_not_being_us - true - Checks that the user has only selected an Account (Organisation) or Contact lookup - NOT( - OR( - ISBLANK( Contact__c ), - ISBLANK( Organisation__c ) - ) -) - You cannot select both an Organisation and Contact at the same time in a Relationship! - diff --git a/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_only_one_lookup_is_populated.validationRule-meta.xml b/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_only_one_lookup_is_populated.validationRule-meta.xml new file mode 100644 index 00000000..6dc6aba2 --- /dev/null +++ b/force-app/main/default/objects/Animal_Relationship__c/validationRules/Check_that_only_one_lookup_is_populated.validationRule-meta.xml @@ -0,0 +1,15 @@ + + + Check_that_only_one_lookup_is_populated + true + Checks that the user has only selected either an Account (Organisation), a Contact or User lookup + NOT( + OR( + ISBLANK(Organisation__c) && ISBLANK(Contact__c) && ISBLANK(Internal_User__c), /* All fields are blank */ + AND(ISBLANK(Contact__c), ISBLANK(Internal_User__c), NOT(ISBLANK(Organisation__c))), /* Only Account is populated */ + AND(ISBLANK(Organisation__c), ISBLANK(Internal_User__c), NOT(ISBLANK(Contact__c))), /* Only Contact is populated */ + AND(ISBLANK(Organisation__c), ISBLANK(Contact__c), NOT(ISBLANK(Internal_User__c))) /* Only User is populated */ + ) +) + You must populate only one of the following lookup fields: Organisation, Contact, or Internal User." + diff --git a/force-app/main/default/quickActions/Animal__c.New_Human_Relationship.quickAction-meta.xml b/force-app/main/default/quickActions/Animal__c.New_Human_Relationship.quickAction-meta.xml new file mode 100644 index 00000000..e99874e6 --- /dev/null +++ b/force-app/main/default/quickActions/Animal__c.New_Human_Relationship.quickAction-meta.xml @@ -0,0 +1,7 @@ + + + Animal_Human_Relationship_Management + + false + Flow + From 4d457eefade62555a103a4b78881e8289b3600d1 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Fri, 17 Jan 2025 12:02:51 +0000 Subject: [PATCH 8/9] Update Animal_Record_Page.flexipage-meta.xml --- .../default/flexipages/Animal_Record_Page.flexipage-meta.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml index e4add4c6..1ef4215f 100644 --- a/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml +++ b/force-app/main/default/flexipages/Animal_Record_Page.flexipage-meta.xml @@ -2190,9 +2190,6 @@ actionNames - - MassChangeOwner - New From b89a8eb28bf8bc861c6b976a4cfd90d360888655 Mon Sep 17 00:00:00 2001 From: Chris Rolfe Date: Fri, 17 Jan 2025 16:17:17 +0000 Subject: [PATCH 9/9] Update Animal_Shelter_Starter.permissionset-meta.xml Updated for Animal Relationship --- ...mal_Shelter_Starter.permissionset-meta.xml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/force-app/main/default/permissionsets/Animal_Shelter_Starter.permissionset-meta.xml b/force-app/main/default/permissionsets/Animal_Shelter_Starter.permissionset-meta.xml index 7a659ca7..9437d777 100644 --- a/force-app/main/default/permissionsets/Animal_Shelter_Starter.permissionset-meta.xml +++ b/force-app/main/default/permissionsets/Animal_Shelter_Starter.permissionset-meta.xml @@ -533,6 +533,11 @@ Animal_Alert__c.Start_Date_Time__c true + + true + Animal_Relationship__c.Active__c + true + false Animal_Relationship__c.Animal_Name__c @@ -543,16 +548,46 @@ Animal_Relationship__c.Animal__c true + + true + Animal_Relationship__c.Contact__c + true + + + true + Animal_Relationship__c.End_Date__c + true + true Animal_Relationship__c.External_Id__c true + + true + Animal_Relationship__c.Internal_User__c + true + + + false + Animal_Relationship__c.Name__c + true + + + true + Animal_Relationship__c.Organisation__c + true + true Animal_Relationship__c.Record_Created__c true + + false + Animal_Relationship__c.Record_Type_Name__c + true + false Animal_Relationship__c.Related_Animal_Name__c @@ -563,6 +598,16 @@ Animal_Relationship__c.Related_Animal__c true + + true + Animal_Relationship__c.Relationship_Types__c + true + + + true + Animal_Relationship__c.Start_Date__c + true + true Animal_Relationship__c.Status__c @@ -1707,6 +1752,14 @@ Animal_Action__c.Treatment true + + Animal_Relationship__c.Animal_Relationship + true + + + Animal_Relationship__c.Human_Relationship + true + Locations__c.Block true