SalesforceFoundation / NPSP

The current version of the Salesforce.org Nonprofit Success Pack
http://www.salesforce.org/nonprofit/nonprofit-success-pack/
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Gift Entry - Opportunities with Matching Information at Updating instead of Importing #6624

Closed mbeaty-sf closed 2 years ago

mbeaty-sf commented 3 years ago

Issue

When a Contact or Account has an existing gift, that is not in a Closed state, Gift Entry is matching to that gift upon Save via the Dry Run. By default the Custom Setting in Custom Settings being referenced by: bdi.diSettings.Donation_Matching_Rulec from Data_Import_Settingsc, are set to "Do Not Match". As Gift Entry no longer navigates to the "Start Import" page after the most recent release, we do not see the same page that we used to; the same one that is still present when importing records through the NPSP Data Importer. Regardless, the Contact and Donation matching rules are meant to respect the Setup > Custom Code > Custom Settings > Data Import Settings > Donation Matching Behaviour, but instead the Gift Entry code is interpreting the Dry Run-matched Opportunities as User Input, and therefore matching them to the Opportunity anyway.


Steps to Reproduce

  1. Create a new contact: Test SFDC with the contact record type. Leave all fields as is aside from first and last name
  2. Create a Gift Entry template that includes Stage as a field on the template
  3. Go to Gift Entry >> Click New Batch >> Select General Gift Entry >> Click Next >> Batch Name: New Test1 -> Next >> Leave the default values as is and click save
  4. Fill in the below details: a. Opportunity Record Type: Donation b. Data Import: Donation Donor: Contact1 c. Data Import: Contact1 Imported: Test SFDC d. Opportunity: Amount: $100 e. Opportunity: Close Date: 08/17/2021 f. Opportunity: Stage: Prospecting
  5. Select "Save & Enter New Gift"
  6. Select "Process Batch"
  7. Go to Gift Entry >> Click New Batch >> Select General Gift Entry >> Click Next >> Batch
  8. Name: New Test2 >> Leave the default values as is and click save
  9. Fill in the below details: a. Opportunity Record Type: Donation b. Data Import: Donation Donor: Contact1 c. Data Import: Contact1 Imported: Test SFDC d. Opportunity: Amount: $100 e. Opportunity: Close Date: 08/17/2021 f. Opportunity: Stage: Prospecting
  10. Select "Save & Enter New Gift"
  11. Select "Process Batch"
  12. Open up the gifts created from the process batch import for both of the donations and notice they are the same

Actual Results: One donation is created. Expected Results: Two donations are created


Cause

The code that is used to check if there is a User-selected match on a DI record, is taking the fact that Dry Run is running as a means to populate the Donation_Imported__c field on the DI record

https://github.com/SalesforceFoundation/NPSP/blob/5363fa8f8ae3ef46a5f305c49e7af4e492a4f0cf/force-app/main/default/classes/BDI_MatchDonations.cls#L174

However, running the Dry Run as a standalone function via the NPSP Data Importer does not populate the Donation Imported field as it is respecting the chosen matching settings which by default are set to "Do Not Match"


Workaround

If a User goes directly to the NPSP Data Importer records that are created by their entries in Gift Entry, and clears out the fields for Donation Imported, Donation Import Status, Payment Imported, and Payment Import Status; and then returns to the Gift Entry batch to process the batch, then new records will be generated as expected instead of updating the records that they were referencing.

mbeaty-sf commented 3 years ago

W-9779730

jesslopez-sf commented 2 years ago

Please follow this Known Issue in the Trailblazer Community for updates.