Check for all task status when project is closed

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • In Progress

I have a application that consists of projects and tasks.  A project can have many tasks linked by the project id.  When I mark a project as complete or cancelled and then go to save it, I would like to check to see if any related tasks are open (not closed or cancelled).  If any tasks have a status other than closed or cancelled, I would like to prevent the project from being saved.

What would be the best approach to accomplish this?

Photo of Tracy

Tracy

  • 40 Points

Posted 3 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Ou can summarize the # of tasks which are incomplete. 

Then you can have a form rule which says that when the record is saved and the status is Complete and the # of tasks which are incomplete > 0, abort the save with a message. 
Photo of Tracy

Tracy

  • 40 Points
Hello,

Thank you for the feedback.  I have what you suggested mostly working.   The only issue that I have is that if the task status is changed within the project form in grid edit mode, the task status summary field does not update and thus I cannot save the project (if I also mark the project as closed).  In other words, if I edit the project and close all tasks via grid edit and mark the project as closed, I cannot save.

Any ideas on how to get around that?

Thanks again.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Hmmm, yes that is tricky.  You could kill that form rule and instead have an Automation fire when Project is saved and the Status is complete and there are still open tasks.  The Automation would reset the status back to some other status like "in progress" or perhaps better yet, "reopened due to tasks still being opened", and then also set an email to fire saying "sorry, but your project has been re-opened as it still has incomplete tasks."

Now, the question is who to fire the email to as the [Last Modified by] will be the Automation owner and not the person who tried to close the project.

So the first step in that Automation will need to be to copy the value in the field [Last Modified by] to a field called [Who to Notify of a Status reversal]. Then you have a field to email to.


Photo of Tracy

Tracy

  • 40 Points
I'm not overly familiar with how the Automation feature works at the Application level so I'll need to play around with that.

Also, on the Form rule that I built, the message that displays on Abort Save shows not only the message that I created but also all the criteria that needs to be satisfied in order to Save.  So the message is kind of messy.  Is there a way to exclude the criteria from the message?