Sunday, October 13, 2019

Beware: Open Project Online resource in 'Edit Resource' blocks the automated modification of that item

The Project Online ResourcePool can be automated managed, e.g. to update a (Custom)Field of an EnterpriseResource. Something that I became aware of is that the automated modification is blocked in case the resource is opened in 'Edit Resource' of the Project Online Web Application (PWA). Apparent PWA applies defensive locking, and already immediate locks the resource through checkout when opening it in the form, and not delayed / just-in-time at the moment of possible save. The automation is blocked both when doing the modification via ProjectServer REST service, as when via the ProjectServer.Client CSOM library.
Open a PO resource in the ‘Edit Form’
(<pwa-url>/_layouts/15/PWA/Admin/AddModifyUser.aspx )
Automation code-snippet to modify EnterpriseResource via REST service
 $body = "{ 'Name':'Test Name', 'Group':'Test Group' }";
 Patch-ReSTRequest $pwaUrl "ProjectServer/EnterpriseResources('$resourceId')" $body
Combination of 'Edit form' + automation execution results in error
{
  "error":
    {
       "code":"10101, Microsoft.ProjectServer.PJClientCallableException",
       "message":
           {
              "lang":"en-US",
              "value":"PJClientCallableException: CICOAlreadyCheckedOutToYou"
           }
    }
}

No comments:

Post a Comment