Question

I'm using the HTML calculated column that's outlined on the pathtosharepoint blog, but I'm wondering, is there any way to create a calculated column, that displays a button/check box or anything that will update both my status and % complete columns at the same time?

So essentially a task complete button, which renders both my status as Completed and my % complete as 100%?

Thanks

Rob

Was it helpful?

Solution

I would agree with Marc that a DVWP would be better in this case. I understand it is not an option for you.

Creating the button is the easy part, the problem is the onclick event handler.

Marc, the amount of script is not necessarily an issue, you can always put it in a function that will be called by the button. The main issue with calculated columns is that you cannot reference the item ID in the formula. You need a workflow trick to copy the ID to a standard field.

The bottom line is that it is not too difficult, but involves multiple steps/workarounds:

  • workflow to copy the ID
  • calculated column that creates the formula
  • text to HTML to display the button
  • externalize the onclick event handler in a function that calls the Web service to update the item.
  • and of course error handling along the way

Are you on SP 2007 or 2010?

OTHER TIPS

IMHO, while what you're suggesting might be possible with an HTML calculated column, you're going to have something far more maintainable and sensical if you use a Data View Web Part (DVWP). Your button or link would need to have a decent amount of script in it and you might even run into a length problem with the column values.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top