Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

Looking for a Web API solution to disable a business unit.

Posted on by 10

I'm looking for a way to use the Web API to disable a business unit and ultimately delete it if possible. I'm aware of the SetStateRequest in the SDK but was hoping for an equivalent Web API action/function. I can't seem to find anything helpful anywhere so hoping someone can help out. I'm suspecting it's not yet possible.

Thanks in advance!

  • Anrini Profile Picture
    Anrini on at
    RE: Looking for a Web API solution to disable a business unit.

    Thanks for the share

  • Verified answer
    Wahaj Rashid Profile Picture
    Wahaj Rashid 11,319 on at
    RE: Looking for a Web API solution to disable a business unit.

    Hi,

    Thank you for your query.

    You can simply update the isdisabled field to true of the Business Unit entity (there is no separate function available to set state in Web API).

    Here is example request:

    PATCH [Organization URI]/api/data/v9.0/businessunits(00000000-0000-0000-0000-000000000001)?$select=name,isdisabled HTTP/1.1  
    OData-MaxVersion: 4.0  
    OData-Version: 4.0  
    Accept: application/json  
    Content-Type: application/json; charset=utf-8  
    Prefer: return=representation  
      
    {"isdisabled":true}

    You can also use delete (using DELETE) verb to remove the BU:

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/update-delete-entities-using-web-api#basic-delete

    DELETE [Organization URI]/api/data/v9.0/businessunits(00000000-0000-0000-0000-000000000001) HTTP/1.1  
    Content-Type: application/json  
    OData-MaxVersion: 4.0  
    OData-Version: 4.0

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans