Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

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

(0) ShareShare
ReportReport
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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans