none
How to link EnterpriseResource with a Sharepoint User using REST API and javascript RRS feed

  • Question

  • Hi,

    I am facing an issue about linking an EnterpriseResource of ProjectServer with a Sharepoint user.

    I tried a patch request with SP.User details, only the enterpriseResource.email is changing, am I missing something ?

    $.ajax({
        type: "PATCH",
        url: "https://<host>/pwa/_api/ProjectServer/EnterpriseResources('<GUID>')",
        headers: {'Content-Type' : "application/json;odata=verbose;charset=utf-8", "Accept": "application/json;odata=verbose", "X-RequestDigest": <digestValue>, 'authorization': <auth>},
        data: JSON.stringify({'__metadata': { 'type': 'PS.EnterpriseResource' }, 'User' : {'__metadata': { 'type': 'SP.User' }, 'LoginName': <LoginName>, 'Email': <EMAIL>, 'UserId': {'__metadata': { 'type': 'SP.UserIdInfo' }, 'NameId': <NAMEID>} }}),
        success: (response, status, xhr) => {
            console.log(response);
        },
        error: function(request, status, error) {
            console.log(request.responseText);
            console.log(error);
        }
    });

    I expect the EnterpriseResource.User to be the User I sent in PATCH request


    Friday, September 6, 2019 11:44 AM

Answers

  • Thank you all for your help, Microsoft has the best dev community in the world !

    I hope I'll never have to work with microsoft again...

    Tuesday, September 17, 2019 1:02 PM