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
Maleek Alves 1Maleek Alves 1 

Test Class issue for Class this is run from the process builder

I know there might be a similar discussion for this but this is a real issue that needs to be highlighted. I have a process builder that runs a class with a @InvocableMethod in.

Every time I run this test class for that classs I get the following error message: CANNOT_EXECUTE_FLOW_TRIGGER

Anyone faced the same issue?
 
doravmondoravmon

Hi, I have had that error before, and this solved!!  Check this link: 
https://success.salesforce.com/issues_view?id=a1p30000000T3sCAAS
Maleek Alves 1Maleek Alves 1
Thanks but this doesnt solve my issue. Or maybe im missing something. I get this error with test classes running the process builder. What do i need to do. Thanks, 
doravmondoravmon
Can you please post your code here?
Maleek Alves 1Maleek Alves 1
The scenario: 
When case comments are made public, an email with a template should be sent out to the customer. 
If you have 5 private comments on a case and you decide to make the 3rd one public, the email template picks up the 5th comment (latest) so workflow won't work. 
So I get the process builder to call a class that gets the correct comment details to be sent out.
My test class for that class will not assert if the class isn't called and the class can't be called because the process builder won't run from a test class hence the error. Make Sense. Unless there is another way to do this. Note: Clicking the Make Public link beside a coment will not fire a trigger. 
Sarah Him&LuiSarah Him&Lui
hey, I need a salesforce CTO for a start up which is going to be on dragons den - Can you help? Are you based in London?
yannick@himandlui.com