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
IamSRNIamSRN 

Package Deployment: Missing Organization Feature: B2C

We are trying to deploy an un-managed package from one Dev org to another. The source has Person account enabled and target does not have Person account. We are not using any feature provided by Person account or standard Account. All the objects, pages, controllers in this package are custom developed. What is the best way to deploy this package in target organization?
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello SRNair, 

You have 2 options - 
1) Either ask salesforce support to enable Person account in the target Org. 
2) OR you will have to modify you code -
 
You should check first whether the Person Account is enabled OR not ?
You can write a utitly method like this - 
public static boolean isPersonAccountEnabled() {
      return Schema.sObjectType.Account.fields.getMap().containsKey( 'isPersonAccount' );      
}
It will return true if person account is enable otherwise false. 

Thnaks, 
Sumit Kumar Singh
IamSRNIamSRN
Hi Sumit,

Thanks for your reply. I do not want to enable Person account in target org. I am not sure how the second option will help my packaging and deployment. Could you please explain a little bit more?
Sumit Kumar Singh 9Sumit Kumar Singh 9
Hello SRNair,

You might be using "isPersonAccount" field in your code somewhere.

Before performing any CRUD operation , pls check that wthether "Person Account" is enabled for that organization or  not? If not, throw an error message. 
To check whether personaccount is enabled or not, you can use the above utility function. 

Thanks,
Sumit Kuamar Singh


 
James GriffinJames Griffin

Hey, 

I'm having this issue as well. Althought our source org has Person Accounts enabled, there are no references to it in our Apex/VisualForce. Is there a way for us to install the package in orgs without Person Accounts enabled?

Thanks, 

James