Skip to content

Breeds Migration

Chris Rolfe edited this page Dec 8, 2023 · 5 revisions

Introduction

If you have installed Animal Shelter Starter Pack post November 16th 2022 for the first time you will automatically be using the new Breeds solution, therefore no action needs to be taken. However, if you are upgrading from a previous version you will need to follow the steps outlined in this document to take advantage of the new Breeds solution

Considerations

Audience

You should have admin knowledge of Salesforce before attempting to step through this guide. If you are not an admin user of Salesforce and would like to implement this solution, complete the [Data Management] module on Trailhead.

Assumptions

This document assumes that you have an understanding of, and have been using the Animal Shelter Starter Pack. If you do not have this understanding then please read the Implementation and Getting Started Guide before continuing.

What if I don’t want to use the new Breeds Solution

Version 1.12 of Animal Shelter Starter Pack will ship with the new Breeds solution already enabled, and to take advantage of this new solution you will need to follow this guide to migrate your data, we highly recommend that you do adopt the new Breeds solution.

If you would like to maintain the ‘Legacy’ Breeds solution which is based on Global Dependent Picklists, then you can. To do this you will need to Edit the following:

  • Animal Page Layout - Remove the new Breed fields, and add the Legacy Breed fields
  • Animal Compact Layout - Remove the new Breed fields, and add the Legacy Breed fields
  • Animal Lightning Record Page - Remove the new Breed fields, and add the Legacy Breed fields
  • Optionally remove the Breeds object from the Animal Shelter App

Migration Process

Process flow diagram

Image Here

Step 1. - Breeds entry/upload

The first step of the migration process is to populate the Breeds object with the relevant records that you need for your organisations.

This effectively means duplicating the Type/Breed picklist values into the Breeds object. On our (Trailblazer Community - Animal Shelter Starter Group) we have provided a Microsoft Excel (.xlxs) file called Animal Taxonomy, which not only includes all the Types and Breeds from our picklists, but many more, and additional fields. You can use this file to upload data into the Breeds object using the standard Salesforce data loading techniques.

Alternatively, you can manually enter the records into the Breeds object.

Whether you upload the records or manually enter them, then the end result should be that the Breeds object contains records for all the Animals breeds you are currently using.

Considerations for Breeds object

  • There is a ‘Active’ field on the Breeds object that is used to filter the lookup relationship between Animal and Breeds.
  • When manually entering a record into the Breeds object, although the Name field needs to be populated as this is a required field, an auto-triggered flow is executed to update the Name field to a combination of “Type - Species”.
  • Duplication rules have been configured, based on Type and Breed to eliminate duplicate records.

Step 2. Running the Process

Once you have completed populating the Breeds object, it’s time to run the migration process.

Image Here

From any Breeds record, you should see the ‘Migrate Breeds’ button. Click on this to initiate the migration.

This starts a Screen flow to migrate the data.

Image Here

Check the box in the bottom left to continue.

This action will carry out the following actions:

  • For each Animal record the flow reads the Type and Breed picklist values, and looks at the Breeds records to find a match.
  • If a match isn’t found, it moves onto the next record.
  • If a match is found, it updates the Animal record Breed lookup with the Id of the matching Breed record, and sets a flag on the Animal record indicating that a match has been successful.

When all Animal records have been processed you will be presented with one of two screens.

Unsuccessful matches

Image Here

If errors have been encountered the following screen will be presented.

Run the report Animals - Breeds Migration Not Completed This will show all the Animal records that were not matched with Breeds. Update the Breeds object with the missing Breed records, and run the Migration process again.

Successful matches

Once you have resolved any missing matches, if required, you will be presented with the following screen

Image Here

This indicates all records have been processed.

Checking the box in the bottom left corner will confirm that you are happy the migration process is complete. This checkbox will set a Custom Setting, to indicate the migration is complete and will prevent the migration process being run again. Should you need to run the process again, a Systems Admin will need to reset the Custom Setting.

Custom Setting

Should you need to run the migration again after it have been marked as complete you will need you Systems Administrator to do the following;

Image Here

From Setup, use the Quick Find box to search for Custom Settings. Locate the Animal Shelter Settings, click Manage, then click Edit. Untick the Breeds Migration Complete checkbox.