Auto adjusting percentages in task list

February 11th, 2009 | Categories: JavaScript, SharePoint

I find it very annoying to have to manually adjust a certain task in task list to 100% after I’ve marked it completed. That’s why I’ve prepared this small script to do this for me.

In the EditForm of the tasks list add the Content Editor WebPart (using the method I already described), open its source editor and paste the following code (make the needed adjustments to adapt it to your language / field names):

Save and confirm the changes.

Now when selecting task status as Completed, the field value will automatically change to 100%, if selecting the status Not Started, the percentage value will be erased or by selecting any other option the percentage value will remain originally changed. The script also considers changes in percentage field (for example if you enter 55% and by mistake change the status to complete – by returning status no other it will return value 55%).

 

Technorati Tags: ,