Workaround for salesforce issue around class versions
CL Loan leverages functionalities that have their source in the CL Common product, such as process enforcement, and configuration manager. For customers upgrading to CL Loan 2.2003 from earlier versions, this functionality may not render correctly due to a Salesforce limitation, as reported here. As per the limitation, when an install of a managed package that depends on other packages is performed there is an insert of the version into a table for each class that is part of the package, or for the classes being updated by the package along with package upgrades, even if there are no dependencies between source and target packages.
CL Loan provides a workaround to this issue, for customers upgrading to CL Loan 2.2003 from version 2.2001 or earlier.
This workaround is mandatory for upgrading customers, to be able to use the Process Enforcement or the Configuration Manager features of CL Loan.
Perform the following steps to implement the workaround:
Log in to your Salesforce account.
Go to Setup, Build, Develop, Apex Classes.
Click New.
In the Apex Class Edit page, paste the following code, and click Save.
//This class is used to overcome Salesforce reverse package dependency issue
global class TypeUtilImpl implements clcommon.IMFiFlexTypeUtil {
global TypeUtilImpl() {
//constructor
}
global Type forName(String nameSpace, String className) {
Organization org = [SELECT NamespacePrefix FROM Organization LIMIT 1];
String orgNameSpace ;
if (org != null){
orgNameSpace = org.NamespacePrefix;
}
Type t = Type.forName(nameSpace, className);
if (t == null) {
t = Type.forName(null, className);
}
if (t == null) { // if still null
t = Type.forName(orgNameSpace ,
className);
}
return t;
}
}