While closing PTASK I need to check some conditions

shivani_jamdade
Tera Contributor

I need some help to implement the functionality. Requirements are as follow: User should be able to close the PTASK only when in the Closure Tab Related Links it has two options Change Number: Change should be in reviewed or closed state and Training date: Date should be future date but till satisfying these conditions the PTASK should not get closed it should throw an error message on the PTASK form that the Date is still in further you cant close the PTASK and if Change is not in reviewed or closed state it should throw and error msg that tha Change is not yet closed.

 

Kindly help me for the same that how should I implement this functionality on the PTASK form on Close Button.

6 REPLIES 6

Can you please help me with the Script for Business Rule? and all the conditions to add 🙂

TIA

StephenR0086629
Tera Contributor

I’ve handled similar validation on PTASK closure using a Business Rule with current.state.changesTo('Closed') and condition checks on related fields. If the criteria aren’t met—like missing actual hours or open subtasks—I use gs.addErrorMessage() to block the update. Client scripts can catch it earlier, but server-side validation ensures data integrity. Just watch out for recursion if you’re updating related records.