You need to sign in to do that
Don't have an account?
Rico Tobias Tägder
The part after "//Call the Flow" is hard for me to get. Maybe you have some examples, links or advices.
Thank you very much in advance!
Test Class for Trigger which Launch Flow
Hi Community,
I'm new in writing Apex Triggers and especially writing test classes.
So it shouldnt be a problem as there is a lot to find how to do it, but I dont find something about writing test classes for Triggers which call a Flow. I tried some standard approaches with no luck.
My Code:
trigger CallHwCalculationFlow on Lead_Product__c (after delete) { //Get Lead__c ID Id leadId; for(Lead_Product__c a: Trigger.old){ leadId = a.Lead__c; } // Call the Flow Map<String, Object> params = new Map<String, Object>(); params.put('CurrentLeadID', leadId); Flow.Interview.Update_Total_HW_Price calcFlow = new Flow.Interview.Update_Total_HW_Price(params); calcFlow.start(); }
The part after "//Call the Flow" is hard for me to get. Maybe you have some examples, links or advices.
Thank you very much in advance!
Greetings!
Please check the below link for the sample example on how to write the test class which calls the flow:
https://salesforce.stackexchange.com/questions/73882/unit-test-for-controller-that-calls-a-flow
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Warm Regards,
Shirisha Pathuri