Skip to main content

Hey folks!

This is an issue I've run into a couple times now. I have a client that has enabled Addresses for Organizational Accounts in NPSP Settings and I have some custom Apex that is adding NPSP Addresses to Accounts. I'm inserting the Custom Setting in my Unit Tests and debuging it right before the Addresses are inserted to confirm it's in there and I'm still getting this error:

"Upsert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, To use Addresses with non-Household Accounts, you must select Organizational Account Addresses Enabled in NPSP Settings"

Does anyone have any insight? Here's the code I'm using to insert the Custom Setting:

insert new npe01__Contacts_And_Orgs_Settings__c(

npsp__Organizational_Account_Addresses_Enabled__c = true,

SetupOwnerId = UserInfo.getOrganizationId()

);

Thanks all!

답변 2개
  1. 10월 27일 오후 8:03

    Hi, I'm also having this mysterious issue now, if anybody has any input! Thanks!

0/9000