Managed Package installation fails in subscriber orgs due to flows being referenced in apex
Last updated 2018-01-18 ·Reference W-4047753 ·Reported By 2 users
Summary
The managed package installation fails with the error message as INVALID TYPE in subscriber orgs if there exists a class in managed package referring a flow.
Repro
In Packaging Org :
1. Create one process, ABC which doesn't contain any subflows, apexplugincalls and actioncalls, activate it.
2. Create one flow, TestCreateAccount (make the name which the flow is processed after the process), activate it.
3. Create following apex classes,
public class FlowController {
public Flow.Interview.TestCreateAccount myFlow {get; set;}
public void start(String name) {
Map<String, Object> myMap = new Map<String, Object>();
myMap.put('AcctName', name);
myFlow = new Flow.Interview.TestCreateAccount(myMap);
myFlow.start();
}
}
@IsTest
private class FlowControllerTest{
static testMethod void testStart() {
new FlowController().start('abc');
}
}
1.5 Apply namespace to the org, create managed package, add process, flow and apex classes, upload the package as managed-released
On Subscriber org :
2.1 Sign up for any EE/DEV org
2.2 Package install fails with the following errors,
1. Invalid type: namespaceabc.TestCreateAccount
FlowController: Invalid type: namespaceabc.TestCreateAccount
2. Dependent class is invalid and needs recompilation:
namespaceabc.FlowController: line 2, column 11: Invalid type: namespaceabc.TestCreateAccount
FlowControllerTest: Dependent class is invalid and needs recompilation:
namespaceabc.FlowController: line 2, column 11: Invalid type: namespaceabc.TestCreateAccountinstall the package
Workaround
Make 2 versions of the package
- 1st version: comment out the flow references in the apex class
- 2nd version: uncomment the lines above
Install 1st version, then install 2nd version
Reported By (2)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.