Using Filters
Many of the P6 EPPM Web Services read operations will return large amounts of data. To limit the data returned from these operations, you can specify an optional filter when calling these operations.
To specify the filter, use the Filter element to filter the returned data by any of the filterable P6 EPPM Web Services fields.
To determine which fields are filterable, refer to the Filterable Orderable column of the object's field list, which can be found in the P6 EPPM Web Services Reference Manual.
For example, calling the ReadActivities operation with no filters specified, results in the return of all activities in the database. You can limit the activities that are returned to those that are related to a project with ObjectId of 123 by applying the following filter:
<Filter>ProjectObjectId = 123</Filter>
The following table contains some common filter examples. Note that the date format for SQL Server is different than the date format for Oracle. When using the examples, be sure to use the date format that is compatible with the database that you are using:
Oracle
TO_DATE('2008-08-13 11:19:36', 'yyyy-mm-dd hh24:mi:ss')
SQLServer
CONVERT(datetime,'2008-08-13 11:22:21',120)
In addition to the Oracle and SQL server date format, you can also use the XML dateTime format in the SQL where clauses that you submit. P6 EPPM Web Services supports the XML dateTime format, with the exception of the fractional seconds and timezones. For example, to return only activities whose Id begins with WS- and whose PlannedStartDate is at 08/01/2003 3:30 am, use the following where clause:
Id LIKE 'WS-%' AND PlannedStartDate = '2003-08-01T3:30:00'
Related Topics
Last Published Thursday, May 2, 2024