Site Home | Login | Membership SignupMaximizing Your Success with Microsoft SharePoint Technologies  

 
DFW SharePoint User Group
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



What is the best way to add calculated fields... Expand / Collapse
Author
Message
Posted 2/1/2008 9:36:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/1/2008 11:27:27 AM
Posts: 2, Visits: 4
I have a pretty simple task to complete. I have a custom list in MOSS 2007 with a date field. I need to calculate a bunch of other dates based on the value of the date field entered and the values of other fields in the list. The standard 'calculated' field type for a column can not accomodate what I am trying to do. I need to add some code to execute every time the date field changes to preform the calculation and write back to the appropriate list columns.

What is the best way to do this? I've tried looking at Sharepoint Designer but do not see an onChange event for a data bound list field control. I've also been struggling trying to write an event handler for the list where I could do the necessary calculations. Can't get it to work so far. Am I missing something in Sharepoint Designer, can I attach code to a change action on a list field?

Thanks so much for any help.

A.

Post #137
Posted 2/1/2008 10:01:29 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/17/2008 2:34:40 PM
Posts: 9, Visits: 25
A.

I'm not sure you want to go the route of adding code to the onChange event of the column.  While not a bad solution, you would need to write a custom field type for that.  It seems that a workflow solution that initiated each time an item was added or changed would suit the problem.  I'm not sure what dates you need to get for the calculation, so I'm not sure if the workflow wizard in SharePoint Designer would work.  There are some great samples for creating workflows in Visual Studio out there.

Good Luck!

Neal Barker

Post #138
Posted 2/1/2008 10:54:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/1/2008 11:27:27 AM
Posts: 2, Visits: 4
Yes, that was my first approach but since I had zero experience with sharepoint programming I thought I'd try out of the box workflows in Designer, but the calculations are too involved for the options that this provides. Later I found some articles on adding a custom event handler to a list item and have been trying to get an itemadded event handler to work ever since. I can post my code if this is something you are familiar with?
Post #139
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.

Permissions Expand / Collapse

All times are GMT -6:00, Time now is 11:43pm

© DFW SharePoint Server Community, all rights reserved. Privacy Policy | Contact Us