function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
porter.mikeporter.mike 

Access public virtual class in managed package (NPSP)

I'm using the NPSP data import advanced mapping to load an Account and a child custom object. Issue is, I am getting duplicates of the custom object. NPSP data import has a way to specify matching rules for Accounts, Contacts, Opportunities, and Payments, but nothing for my custom object.

There is a public virtual class BDI_ObjectMappingLogic that would let me add custom matching, but of course it's public so I get the
Compile Error: Type is not visible: npsp.BDI_ObjectMappingLogic
Anyone have any experience with matching rules for custom objects in NPSP data import advanced mapping? Or with using unmanaged apex to override a public virtual managed package class? Or, with installing open-source NPSP outside of the managed package?



 
Best Answer chosen by porter.mike
AbhishekAbhishek (Salesforce Developers) 
Hi Mike,

By default, classes and methods in Managed Packages are not visible for you in Apex, unless they are defined as Global. The class you are referring to is probably not defined as global, so you cannot use it in Apex, unfortunately.

From Salesforce Help:
The public access modifier declares that this class is visible in your application or namespace. The global access modifier declares that this class is known by all Apex code everywhere.

Please find the help on the link given below :
https://developer.salesforce.com/forums/?id=906F00000008u4SIAQ

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.

All Answers

AbhishekAbhishek (Salesforce Developers) 
Hi Mike,

By default, classes and methods in Managed Packages are not visible for you in Apex, unless they are defined as Global. The class you are referring to is probably not defined as global, so you cannot use it in Apex, unfortunately.

From Salesforce Help:
The public access modifier declares that this class is visible in your application or namespace. The global access modifier declares that this class is known by all Apex code everywhere.

Please find the help on the link given below :
https://developer.salesforce.com/forums/?id=906F00000008u4SIAQ

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.
This was selected as the best answer
Ankit Solanki 6Ankit Solanki 6
@mike - follow this link for matching rules for custom objects in NPSP data import advanced mapping: https://powerofus.force.com/s/article/NPSP-Map-Using-Advanced-Mapping
Ankit Solanki 6Ankit Solanki 6
HI @Mike Porter 18, If it's solved, will you mark as solved please ?
porter.mikeporter.mike
Spoke to folks at NPSP and confirmed it's currently not possible