Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Patch ownerid give 'forbidden' error

Posted on by 5

I'm trying to update the ownerid via HTTP request

accountToUpdate.Add("ownerid@odata.bind", "/systemusers(" + ReizigerGuid + ")");

HttpRequestMessage updateRequest = new HttpRequestMessage(new HttpMethod("PATCH"), crmApiUrl + "accounts(" + AccountId + ")");
updateRequest.Content = new StringContent(accountToUpdate.ToString(), Encoding.UTF8, "application/json");

But i'm getting an forbidden error. Can someone explain what could be wrong of why this isn't working?

all other request do work.

*This post is locked for comments

  • Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Patch ownerid give 'forbidden' error

    Please mark as verified answer on clicking Yes option provided below suggested answer

  • nmylle Profile Picture
    nmylle 5 on at
    RE: Patch ownerid give 'forbidden' error

    How do I close the tread? :)

  • Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Patch ownerid give 'forbidden' error

    Please close the tread so it could help to others as well

  • Suggested answer
    nmylle Profile Picture
    nmylle 5 on at
    RE: Patch ownerid give 'forbidden' error

    Found the problem. The systemuser I wanted to assign to the account as owner needed a specific security role.

  • nmylle Profile Picture
    nmylle 5 on at
    RE: Patch ownerid give 'forbidden' error

    Hi,

    I can create/write/update account entities with this user.

    The user has 'System administrator' role, and this role has all rights if I check the 'core records' in the security roles for the 'account' entity.

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Patch ownerid give 'forbidden' error

    Like Pawar said check the user permission and also make sure that the Guid does not have {}.

  • Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Patch ownerid give 'forbidden' error

    Looks like user don't have write access of account entity.

    Are you getting this issue for system admin ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans