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
Jordan@BracketLabsJordan@BracketLabs 

Installing package into Professional Edition w/ RecordTypes

We have a package that supports RecordTypes, but we want to install into a professional edition org.

 

To accomplish this I am attempting to build the code to avoid direct references to the RecordType fields as follows:

 

        Integer countOfRecordTypes = 0;
        // Find if record types are enabled -Ken
        string recordTypeSoql = 'SELECT Id,Name FROM RecordType WHERE sobjecttype = \'Campaign\'';
        for(sObject s : Database.query(recordTypeSoql)) {
        	countOfRecordTypes++;
        }
        
        if(countOfRecordTypes > 0)
        {
            this.isRecordTypeEnabled = true;	
        }
        else
        {
        	this.isRecordTypeEnabled = false;
        }

 I use the count of RecordTypes to determine if the property even exists, and I don't directly SOQL Query for RecordType objects.

 

However, the professional edition install process still fails with an unkown internal error, which I've been told by partner support is a 'RecordType related error.'

 

Any advice?

 

P.S. I've also attempted to use .getRecordTypeInfos() --> which also fails.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Chris JohnChris John

You have a couple of options:

 

1. Use dynamic apex

2. Have a base and extension version of the package, the base would install in PE orgs, the extension would contain the EE only features.

 

The options are explained in this article (worth a read in general if developing for Professional Edition):

http://wiki.developerforce.com/page/Designing_an_Application_for_Group_and_Professional_Edition

 

What was the error code returned when the install failed, out of interest?

 

-cj

All Answers

Chris JohnChris John

You have a couple of options:

 

1. Use dynamic apex

2. Have a base and extension version of the package, the base would install in PE orgs, the extension would contain the EE only features.

 

The options are explained in this article (worth a read in general if developing for Professional Edition):

http://wiki.developerforce.com/page/Designing_an_Application_for_Group_and_Professional_Edition

 

What was the error code returned when the install failed, out of interest?

 

-cj

This was selected as the best answer
Jordan@BracketLabsJordan@BracketLabs

Looks like we're going to have to build a 2nd codebase to remove any non-PE-friendly elements (The error was actually being caused by an already packaged 'Permission Sets' error, using dynamic SOQL was capable of gettng us around the RecordType issue.

IspitaIspita

Is there specific method to be followed for generating :-

 

1. Base Package

2. Extension Package

 

Please give some insight into it and please share some resource reference .....

@altius_rup@altius_rup
Jordan,
Once you lade your code dynamic, did you manage to remove the dependency between your package and the record type feature ? Without creating another package ?

Rup