Code sample to do add a date to a resource calendar?

M

Melt16

Hi,

I am figuring out how to add a date into a resource calendar on Project
Server 2007. I am using the PSI web services, and assume the Calendar
Webservice is the way to go. Although I can't find many helpful code samples.

Can anyone point me in the right direction on how to insert some dates into
a resource calendar?

Basically we have a custom Leave system, and when an employee books leave,
we would like it to update the Project Server calendar that thge resource is
not available for those dates.

Thanks
 
R

Ray McCoppin

You will need to work with the CalendarDataSet that is returned fron the
ReadCalendars PSI call. You will also need to checkout the calendar. To add
exceptions to the calendar you will need to add rows to some of the dataset
tables.
Once the Dataset is updated you will need to use the UpdateCalendars method
passing it the updated dataset. I would suggest this articile:

http://msdn.microsoft.com/en-us/library/ms421300.aspx


Hope this help
--
Ray McCoppin

http://www.randsmanagement.com
Project Server 2007 Automation Tools
Project Server 2007 Archive Tool
SRS gantt charts
 
M

Maik

Hi Melt16,

i´m not sure if i get you right, but if you want to add a date where
a resource is non-working, have a look at the ResourceWebService.

Use the ReadResource(<resourceGuid>) Method,
get a new row from the CalendarException Table with
NewCalendarExceptionsRow(),
checkout the resource with CheckOutResources(<guidArray>),
fill the new row with the data you want,
add the new row to the CalendarExceptions table with the
AddCalendarExceptionsRow(<exceptionsRow>) and
call the UpdateResources method (if you want with autoCheckIn, otherwise
you´ve to check in the resource manually by using CheckInResources method).

You can verify the new resource calendar exception entry e.g with
ProjectProfessional , open EnterpriseResource Pool, pick the resource , click
"Change Working Time" , you should see the new non-working day entry on the
Exception Tab.

Greets
Maik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top