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
Christine_KChristine_K 

Internal Salesforce.com Error Invoking a Flow with Apex

Has anyone run into issues invoking a flow using apex? The logs show that the flow is being started and populated but at the end of the log files it says Internal Salesforce.com Error.

Code to start the flow:
//get the subscriptions
List<Subscription__c> subscriptions = [select id, expiry_date__c, recordTypeId, Renewal_Status__c from subscription__c where id = 'a09S0000006EQ6CIAW'];

//create the flow parameter
Map<String, Object> myMap = new Map<String, Object>();
myMap.put('SelectedSubscriptions', subscriptions);

//launch the flow
Flow.Interview.Subscription_Debug_Flow myFlow = new Flow.Interview.Subscription_Debug_Flow(myMap);
myFlow.start();

I have a custom button which launches the flow from the UI when a subscription has been selected.  This works perfectly and no errors are generated so I know it can't be an issue with the flow itself as it does work.
Best Answer chosen by Christine_K
KaranrajKaranraj
If you are getting Internal salesforce error, then please raise support case with salesforce to get more details. Check here about Internal salesforce.com error/Gack (https://developer.salesforce.com/blogs/engineering/2015/02/gack.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SforceBlog+%28Salesforce+Developers+Blog%29)