Enterprise Calendar through PSI

R

Ricardo Marques

Hello, I'm trying to do a simple Project Server API evaluation, my purpuse is
to import my company holidays from a XML file and update the project server
enterprise calendar.

But my problem, starts with reading the calendar exceptions.. here's my very
simple code:

PSLibrary.Filter filter = new PSLibrary.Filter();
CalendarDataSet dsCalendars = new
WebSvcCalendar.CalendarDataSet();

filter.FilterTableName = dsCalendars.Calendars.TableName;

filter.Fields.Add(new PSLibrary.Filter.Field(
filter.FilterTableName,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
PSLibrary.Filter.SortOrderTypeEnum.Asc));

filter.Criteria = new PSLibrary.Filter.FieldOperator(
PSLibrary.Filter.FieldOperationType.Equal,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
"Padrão");

dsCalendars = wsCal.ReadCalendars(filter.GetXml(), false);

foreach (CalendarDataSet.CalendarsRow calRow in
dsCalendars.Calendars.Rows)
{
Console.Out.WriteLine(calRow.CAL_NAME + " (" +
calRow.CAL_UID.ToString() + ")");

if (calRow.GetCalendarExceptionsRows().Length > 0)
{
Console.Out.WriteLine("Exceptions:");
foreach (CalendarDataSet.CalendarExceptionsRow
calException in calRow.GetCalendarExceptionsRows())
{
Console.Out.WriteLine(calException.Name);
}
}
}

Problem here is that GetCalendarExceptionsRows returns me an empty array,
and it's weird because i have 100% sure that are exceptions on the calendar,
i can see them on project professional.

I think the way I'm using to access the data may not be the correct one, but
haven't found many docs about it.

PS: I've tried the ListCalendars() and the result is the same.
 
R

Ricardo Marques

Hello

I'm not sure what you mean with patchlevel....

This is a simple console application invoking PS API
 
W

winnes

Any progress on this?
I have the exact same problem!
All the latest service packs installed (w2003,wss,projectserver,...)
 

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