Forum Discussion
DylanCristy
Sep 01, 2022Copper Contributor
Is it possible to interact with Project Server data from a Project Server server-side event handler?
I have MS Project Server running on a SP 2016 on-prem SharePoint farm. I have set up server side event handlers for the OnPublishing and OnPublished events. Everything is configured correctly for...
Paul_Mather
Sep 02, 2022MVP
Hello DylanCristy ,
Does the user account that you are specifying as part of the auth have edit access to that project you are trying to update? Have you tried running the update code in isolation in a console app etc. Does that auth OK?
Paul
- DylanCristySep 02, 2022Copper ContributorHi @PaulMather, I added the account as part of the "Administrators for Project Web App" group. Regardless of whether or not that gives them edit access to the project file itself, I think it should give them access to the Enterprise Custom Fields, right? The first thing I was trying in my code was, in CSOM:
var field = projectCtx.CustomFields.GetByGuid(fieldID);
projectCtx.Load(field);
projectCtx.ExecuteQuery();
and using REST I was trying to GET /_api/ProjectServer/CustomFields('fieldId')
and neither of those worked. I do think it has something to do with claims auth though, we ended up turning off claims auth in my development environment, and now the CSOM code is working. Not fully, yet, I still have some issues to work out, but I can at least load the custom field and load the project.
Do you have any advice on how to use the CSOM using claims auth?