1

I have a process builder in a custom object called Grant_Report__c.

Over there, if an email field is filled, I have a scheduled action to send an email 30 days before the Due_date__c field (it is a date field):

enter image description here

I did that process builder a year ago, and I have more than 1000 flow interviews that are waiting to send this email 30 days before that field.

Now I want to change the scheduled action Time for Actions to Execute from 30 days to 14 days. I understand that the interviews won't re-evaluate themselves automatically - Idea

QUESTION

I want to change my days of Time for Actions to Execute from 30 to 14 and then update all my interview records to re-evaluate their criteria or to delete them and re-create them, so all interviews would count agains 14 days before the date.

Is there a quick way to do that - maybe with an SOQL query or other way?

1

Rather than searching and deleting interview records, you can run a SOQL query where due date is on future date where those interviews have been queued.

Run a DML update operation on the Grant_Report__c records and because of this update it will re-evaluate the process and previous interviews will be out of the queues and new interviews will be queued.

You can quickly test at your sandbox before moving it to production.

How do I make sure these would be on the new criteria?

Since you are making changes to the process so it will create new version and after updating all the records, new pending and waiting interviews will get created.

You can monitor those upon reaching Setup->Flows and then Paused and Waiting Interviews.

Here is an example taken from my DE

Flow Monitoring

For more information, refer Monitor Your Processes’ Pending Scheduled Actions

If you still need to delete all pending interviews then write a SOQL query to retrieve records based on InterviewLabel with other suitable criteria and delete those.

FlowInterview fiObj = [SELECT CurrentElement,Guid,Id,InterviewLabel,IsDeleted,Name 
                       FROM FlowInterview
                       WHERE InterviewLabel = 'Sent_Email_after_case_creation-1_InterviewLabel' LIMIT 1];
delete fiObj;
  • I did that, now I still have many FlowInterview records that run with the old flow version - that means they run on the old criteria, how do I make sure these would be on the new criteria? – Itai Shmida Nov 11 '18 at 13:23
  • Refer my undated answer, hope it will work for you as it worked for me – Santanu Boral Nov 11 '18 at 16:25
  • 1
    Thanks @SantanuBoral, combining all your answer helped me to organize all my processes and FlowInterviews – Itai Shmida Nov 12 '18 at 9:38

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.