I have been working on a web part that lives on a SharePoint site in a Project Web App instance, and interacts with Project Server using the Project REST API.
I need to be able to get tasks based on the value of a local custom field (not enterprise), and I'm having a heck of a time doing that using REST, because apparently if a local custom field does not have a value for a particular task, then that property simply does not exist on that task, which messes up the query for tasks that do have a value assigned because the server will come back with a 400 Bad Request error with the detail
Field or property "LocalCustom_Published_[GUID]_[GUID]" does not exist.
even though it does exist for the tasks I'm actually trying to find.
(See some of my other trials and tribulations here.)
I recently discovered (rediscovered?) that there is a JSOM for Project Server that is extremely similar to the SharePoint JSOM: you do context.get_current()
, load this, load that, then executeQueryAsync()
to get the results.
With the SharePoint JSOM, I know that you can get items using a CAML query, which is functionally equivalent to using an oData $filter
in a REST request - you're basically saying "give me all the items where this particular field has this specific value."
So, is there some kind of equivalent functionality in the Project Server JSOM? I have not been able to find any examples... can you use a CAML query against Project Server? Or is there some other way to get tasks with a specific value in a specific field?