alexed1 / LightningFlowComponents

A collection of unofficial Flow extensions that can be used to enhance Salesforce Flow and Orchestrator.
http://unofficialsf.com
Other
584 stars 575 forks source link

Extract Strings From Collection - Scheduled Flow - Profile does not have access to: extractstringsfromcollection #492

Open hwong103 opened 4 years ago

hwong103 commented 4 years ago

Not sure if anyone has come across this yet or if I'm missing something but the Extract Strings from Collection action seems to perform differently in a Scheduled Flow vs a Screen Flow. I've built it out exactly the same between the two different types of flows and the scheduled one gives me an error whereas the screen flow performs as expected

Error Occurred: Profile does not have access to: extractstringsfromcollection

Is there something different in how scheduled flows work?

adwhite75 commented 3 years ago

This is a known issue with the Automated Process user and scheduled flows invoking apex if you have a specific update enabled - https://help.salesforce.com/articleView?id=flow_considerations_trigger_schedule.htm&type=5

If you need a scheduled flow to invoke Apex code, don’t activate the Require User Access to Apex Classes Invoked by Flow critical update. When that critical update is activated, the scheduled flow fails when it invokes Apex.

I believe there is a fix planned but I don't know where that is being tracked.

clifford-fra commented 3 years ago

As a workaround, you can add access to the apex classes of the autoproc user:

  1. Query the profileId of the autoproc user with: system.debug([select username, profileId from user where username LIKE 'autoproc%']);

  2. Open the correct url: https://[YourDomain].my.salesforce.com/_ui/system/user/ProfileApexClassPermissionEdit/e?profile_id=[AutoProcProfileID]

  3. Add the apex classes and save