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

Invocable methods

Ive created a function just as a test for now 

    @InvocableMethod(label='Setup_Salesforce_To_Salesforce_Email' description='Sends a Email To Explain Setup Of Salesforce To Salesforce')
    global static void sendSFToSFSetupEmail(String[] emls){
            Document doc = [Select Body From Document where id='015E00000068ZLg'];
            system.debug('## doc ' +doc);
            String PDFOutputBOL =  (doc.Body).toString();
            system.debug('## PDFOutputBOL ' +PDFOutputBOL);
        catch(Exception ex){}

Here's the PB Ive setup

User-added image

But when I create a lead I get this error

The record couldn’t be saved because it failed to trigger a flow. 
A flow trigger failed to execute the flow with version ID 301E0000000TjxN. 
Contact your administrator for help.

Any ideas?
Just to give more info, the user does have a flow license 

Also I receive an email of the error

Errorcaused by element : FlowActionCall.myRule_1_A1
caused by: Probably Limit Exceeded or 0 recipients 

I dont know what limit this will be
Ive solved this issue. A word for anyone making PBs, start small and test and then add more actions etc and test every stage as you build the PB otherwise you will spend time unpicking and trying to find which part works which doesnt