Skip to main content
How can we create a validation that requires all tasks to be complete before changing a specific field.

 

Ex: For our opportunities, we're automatically tasking opportunity owners with different tasks per opportunity stage, but we want to require that they complete all tasks for the current stage before changing the stage the next value.

 

Thoughts?
1 respuesta
  1. 25 feb 2014, 21:00
    I am afraid your only option would be an Apex Trigger on the Opportunity object. So the logic is this( just in case if it helps ):

     

    • Identify who is making the change to the Opportunity record

    • Scan the Database to see if there are any Tasks pending as of now [You will have to find those Tasks of the Current User that deals with the Opportunity Stage associated Tasks by looking at that field on the Task record that would help us to uniquely distinguish such types of Tasks]

    • If the COUNT is greater than zero, then you can throw an Error

    • You will need an Before Update Apex Trigger on the Opportunity object

0/9000