diff --git a/cumulusci.yml b/cumulusci.yml
index aabfb77826..c043ab44ed 100644
--- a/cumulusci.yml
+++ b/cumulusci.yml
@@ -938,6 +938,40 @@ flows:
2:
task: update_admin_profile
+ enable_gift_entry:
+ description: Enable the Gift Entry feature.
+ group: NPSP
+ steps:
+ 1:
+ flow: enable_advanced_mapping
+ 2:
+ task: execute_anon
+ options:
+ apex: >
+ String namespace = ('%%%NAMESPACE%%%').replace('__','');
+ Type t = Type.forName(namespace, 'Callable_Api');
+ Callable apiClass = (Callable)t.newInstance();
+ apiClass.call('settings.enablegiftentry', null);
+
+ enable_advanced_mapping:
+ description: Enable the BDI Advanced Mapping feature.
+ group: NPSP
+ steps:
+ 1:
+ task: execute_anon
+ options:
+ apex: >
+ String namespace = ('%%%NAMESPACE%%%').replace('__','');
+ Type t = Type.forName(namespace, 'Callable_Api');
+ Callable apiClass = (Callable)t.newInstance();
+ apiClass.call('settings.enableadvancedmapping', null);
+ 2:
+ task: custom_settings_value_wait
+ options:
+ object: "%%%NAMESPACE%%%Data_Import_Settings__c"
+ field: "%%%NAMESPACE%%%Field_Mapping_Method__c"
+ value: "Data Import Field Mapping"
+
enable_rd2:
description: 'Fully configures and enables a Scratch org with Enhanced Recurring Donations (unmanaged code only)'
group: NPSP
diff --git a/documentation/automation.md b/documentation/automation.md
index 29c794fbfb..b842a5e822 100644
--- a/documentation/automation.md
+++ b/documentation/automation.md
@@ -79,6 +79,20 @@ as well as many other features needed to define the workspace for the org's inte
| `enable_crlp` | Task | Enable the NPSP Customizable Rollups feature (works for both Managed and Unmanaged) |
| `enable_incremental_rollups` | Task | Configure NPSP Customizable Rollups to activate Incremental Rollups |
+### Advanced Mapping
+
+| Name | Type | Description |
+| ----------------------------- | ---- | -------------------------------------------------------------------------------------------- |
+| `enable_advanced_mapping` | Flow | Enable the BDI Advanced Mapping feature (unmanaged code only).
+| `enable_advanced_mapping_managed` | Flow | Enable the BDI Advanced Mapping feature (managed package only)
+
+### Gift Entry
+
+| Name | Type | Description |
+| ----------------------------- | ---- | -------------------------------------------------------------------------------------------- |
+| `enable_gift_entry` | Flow | Enable the Gift Entry feature (unmanaged code only).
+| `enable_gift_entry_managed` | Flow | Enable the Gift Entry feature (managed package only)
+
### Enhanced Recurring Donations
| Name | Type | Description |
diff --git a/force-app/main/default/classes/AdvancedMappingEnablementService.cls b/force-app/main/default/classes/AdvancedMappingEnablementService.cls
new file mode 100644
index 0000000000..3d382f992b
--- /dev/null
+++ b/force-app/main/default/classes/AdvancedMappingEnablementService.cls
@@ -0,0 +1,63 @@
+/*
+ Copyright (c) 2022, Salesforce.org
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Salesforce.org nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+/**
+ * @author: Salesforce.org
+ * @date: 2022
+ * @description: Service to enable the advanced mapping feature
+ */
+public with sharing class AdvancedMappingEnablementService {
+
+ @TestVisible
+ private BDI_MigrationMappingUtility migrationMappingUtility {
+ get {
+ if (migrationMappingUtility == null) {
+ migrationMappingUtility = new BDI_MigrationMappingUtility(new BDI_MigrationMappingHelper());
+ }
+ return migrationMappingUtility;
+ }
+ set;
+ }
+
+ public Id enable() {
+ migrationMappingUtility.migrateHelpTextToCustomMetadata();
+
+ Id deploymentId = CMT_MetadataAPI.deployMetadata(
+ migrationMappingUtility.queuedMetadataTypesForDeploy,
+ new BDI_MigrationMappingUtility.DeploymentCallback());
+
+ return deploymentId;
+ }
+
+ public Boolean isEnabled() {
+ Data_Import_Settings__c dataImportSettings = UTIL_CustomSettingsFacade.getDataImportSettings();
+
+ return dataImportSettings.Field_Mapping_Method__c == BDI_MigrationMappingUtility.DATA_IMPORT_FIELD_MAPPING;
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/classes/AdvancedMappingEnablementService.cls-meta.xml b/force-app/main/default/classes/AdvancedMappingEnablementService.cls-meta.xml
new file mode 100644
index 0000000000..f928c8e56b
--- /dev/null
+++ b/force-app/main/default/classes/AdvancedMappingEnablementService.cls-meta.xml
@@ -0,0 +1,5 @@
+
+
+ 53.0
+ Active
+
diff --git a/force-app/main/default/classes/AdvancedMappingEnablementServiceMock.cls b/force-app/main/default/classes/AdvancedMappingEnablementServiceMock.cls
new file mode 100644
index 0000000000..87c61911e4
--- /dev/null
+++ b/force-app/main/default/classes/AdvancedMappingEnablementServiceMock.cls
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright (c) 2022, Salesforce.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Salesforce.org nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * /
+ */
+/**
+* @author Salesforce.org
+* @date 2022
+* @description StubProvider mock for tests
+*/
+public with sharing class AdvancedMappingEnablementServiceMock implements StubProvider {
+ public Boolean enableAdvancedMappingCalled = false;
+ public Boolean isEnabled = false;
+
+ public void setEnabled() {
+ isEnabled = true;
+ }
+
+ public Object handleMethodCall(
+ Object stubbedObject,
+ String stubbedMethodName,
+ Type returnType,
+ List listOfParamTypes,
+ List listOfParamNames,
+ List