Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Can not read the Resource Calendar Exceptions using PSI

$
0
0

Hello,

 

I'm trying to read the CalendarExceptions for a Resource, but I'm getting a Fault Exception every time (System.ServiceModel.FaultException`1 was unhandled

  Message=ProjectServerError(s) LastError=GeneralUnhandledException Instructions: Pass this into PSClientError constructor to access all error information).

 

I attach here the code I'm using - what am I doing wrong? - Thanks!

 

            // Get the ID of the user.
            Guid currentUserGuid = resourceClient.GetCurrentUserUid();

            //Prepare filter
            SvcResource.ResourceDataSet resourceDS = new SvcResource.ResourceDataSet();

            PSLibrary.Filter filter = new PSLibrary.Filter();

            filter.FilterTableName = resourceDS.Resources.TableName;
            //filter.FilterTableName = resourceDS.CalendarExceptions.TableName;

            filter.Fields.Add(new PSLibrary.Filter.Field(resourceDS.CalendarExceptions.TableName,
                resourceDS.CalendarExceptions.RES_UIDColumn.ColumnName,
                PSLibrary.Filter.SortOrderTypeEnum.None));

            filter.Fields.Add(new PSLibrary.Filter.Field(resourceDS.CalendarExceptions.TableName,
                resourceDS.CalendarExceptions.StartColumn.ColumnName,
                PSLibrary.Filter.SortOrderTypeEnum.None));

            filter.Fields.Add(new PSLibrary.Filter.Field(resourceDS.CalendarExceptions.TableName,
                resourceDS.CalendarExceptions.FinishColumn.ColumnName,
                PSLibrary.Filter.SortOrderTypeEnum.None));

            //Add a filter to restrict the return results to the current user
            PSLibrary.Filter.FieldOperator criteriaCurrentResource = new PSLibrary.Filter.FieldOperator(
                PSLibrary.Filter.FieldOperationType.Equal,
                resourceDS.Resources.RES_UIDColumn.ColumnName,
                currentUserGuid.ToString()
                );

            filter.Criteria = criteriaCurrentResource;

            resourceDS = resourceClient.ReadResources(filter.GetXml(), false);

 

 

 


Joao

Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>