+ Start a Discussion
Peter LolloPeter Lollo 

Apex trigger overwriting membership info on account object

Every time I create an Account object, within a few days all the data associated with that Account's Membership fields gets erased. I added tracking of Activity History for Account objects, and I can see that the Membership data supposedly gets erased by one of my coworkers. However, this coworker is not actually entering Salesforce and editing any data. I think the problem is an Apex trigger that was created by said coworker. The only Apex trigger we have is indeed created by this coworker, but I don't know how to delete the trigger. The only option I seem to have is to uninstall the package associated with this Apex trigger. That package is the "Nonprofit Success Pack," which I am hesitant to uninstall because it seems like it might be an important package. Also, I am sure there must be an easier way to remove or edit the trigger without removing the package. Any suggestions? 

Thanks in advance!
Best Answer chosen by Peter Lollo
Peter LolloPeter Lollo
So, after talking with David from Salesforce Support, we found the issue. If you edit the Membership and Donation fileds directly on an Account or Contact object, it will get overwritten by a nightly (apex?) trigger included in the NPSP package. This trigger rolls up all the Membership and Donation info entered through the Opportunities section for a given Account or Contact, and this "rolled up" info will replace anything you directly enter on the Account or Contact object. See David's answer below for more info:

...those fields are rollup summary fields derived from the opportunities on the contact. 

Here are a couple of articles that might help: 

https://powerofus.force.com/articles/Resource/NPSP-Working-with-Memberships 

https://powerofus.force.com/articles/Resource/NPSP-Automatically-Create-and-Update-Campaign-Members-Through-an-Opportunity 

You cannot use manual input membership info because those are roll up summary fields.

All Answers

Sumeet_ForceSumeet_Force
You can deactivate the trigger. If its prod, you would need to deactivate it on sandbox and then migrate it. Deletion is also an option via migration. I dont think the managed trigger would be causing this issue. So a custom trigger would be the cause that can be deactivated.
Peter LolloPeter Lollo
So, after talking with David from Salesforce Support, we found the issue. If you edit the Membership and Donation fileds directly on an Account or Contact object, it will get overwritten by a nightly (apex?) trigger included in the NPSP package. This trigger rolls up all the Membership and Donation info entered through the Opportunities section for a given Account or Contact, and this "rolled up" info will replace anything you directly enter on the Account or Contact object. See David's answer below for more info:

...those fields are rollup summary fields derived from the opportunities on the contact. 

Here are a couple of articles that might help: 

https://powerofus.force.com/articles/Resource/NPSP-Working-with-Memberships 

https://powerofus.force.com/articles/Resource/NPSP-Automatically-Create-and-Update-Campaign-Members-Through-an-Opportunity 

You cannot use manual input membership info because those are roll up summary fields.
This was selected as the best answer