We have a code that prevents us from closing a project if there are still open activities.

The trouble is that it picks up the "Not Started" Status update on the Recurring Tasks Series, even when the series has ended (end date has passed). The Status of the actual Recurring Series record can't be updated: enter image description here

The code is:

public static void checkIncompleteTask(List<amc__Project__c> newList, Map<Id, amc__Project__c> oldMap) {

        List<Task> taskList = [SELECT Id, WhatId FROM Task WHERE WhatId IN: newList AND Status != 'Completed'];

Can anyone assist in excluding Recurring Series records from this? It doesn't appear as a separate RT, and isn't a reportable activity in itself.

Cheers, Nat


We have one field on Task IsRecurrence which you can use here.

Add this parameter in your query

IsRecurrence = false

So it will exclude all the Recurring Series records.

  • 1
    Thanks so much Tushar!! I'll pass that on to my internal team to look at updating the code :) – Nat Jan 11 '18 at 5:56

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.