1

I have a flow that calls an invocable action from apex class. It accepts a list of required parameters and the flow has been working for the last 2 years. And then something happened and the flow started giving a permission error (see below). Though the flow wasn't changed since then and permissions for the profiles weren't changed as well. All profiles have access to the apex class and Manage Flow AND View All Data permissions. A couple of days ago we deployed critical updates in our org but don't think anything would result in this behavior.

enter image description here

And here's an invocable class that gives a permission error. Tried to use without sharing and global attributes and didn't work any.

public without sharing class  AddTaskAsEmailActivity {
    
    public class InvocableVariables {
        @InvocableVariable(required=true) 
        public String emailTemplateDeveloperName;

        @InvocableVariable(required=true) 
        public Id caseId;

        @InvocableVariable(required=true)
        public String toAddress;

        @InvocableVariable(required=true)
        public String fromAddress;
    }

    @InvocableMethod(Label='Create Email Message Activity' Description='Creates email message as activity and attaches to case')
    public static void init(InvocableVariables[] variables) {
        for (InvocableVariables params : variables) {
            createTaskAsActivity(params);
        }
    }

    public static void createTaskAsActivity(InvocableVariables params) {....}

Does anyone have any ideas what could be the problem?

2
  • 1
    It is likely the critical update. Please check that the profile in question has access to flow and the classes that is being called from the flow.
    – manjit5190
    Jul 30 '20 at 14:20
  • @NGix were you ever able to figure this out?
    – jonnybro
    Dec 10 '20 at 15:58
0

Open profile setup then 'Apex Class Access' and make sure 'AddTaskAsEmailActivity' class is in the allowed list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.