web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

API to update business unit of Teams in dynamics 365

(0) ShareShare
ReportReport
Posted on by 65

can anyone share  API to update  Business unit of Teams 

I have the same question (0)
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello Josh,

    Please refer below article to set the lookup value using web API.

    carldesouza.com/.../

    and to set the BU of a team u need to pass the parameter like below.

    entity["businessunitid@data.bind"]="/businessunits(give GUID of Business unit here)";

    Also if you want to set more property in the Team entity please refer below link.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/team?view=dynamics-ce-odata-9

    Thank you,

    Amit Katariya

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    Please see below code to update Business Unit of a Team from JS -

    var record = {};

    record["businessunitid@odata.bind"] = "/businessunits(80c4ecda-4c5a-ec11-8f8f-002248d4e639)";

    var req = new XMLHttpRequest();

    req.open("PATCH", Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.2/teams(74b5a34d-fb2f-ec11-b6e6-6045bda5714a)", true);

    req.setRequestHeader("OData-MaxVersion", "4.0");

    req.setRequestHeader("OData-Version", "4.0");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Prefer", "odata.include-annotations=*");

    req.onreadystatechange = function () {

    if (this.readyState === 4) {

    req.onreadystatechange = null;

    if (this.status === 204) {

    console.log("Record updated");

    } else {

    console.log(this.responseText);

    }

    }

    };

    req.send(JSON.stringify(record));

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Josh_1627 Profile Picture
    65 on at

    i have found this article , can anyone help me in writing api query to update team business unit .

    docs.microsoft.com/.../microsoft.crm.sdk.messages.setparentteamrequest.businessid

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    HI,

    This message request is deprecated. Consider using the UpdateRequest instead. For more information see Perform specialized operations using Update.

    docs.microsoft.com/.../microsoft.crm.sdk.messages.setparentteamrequest.businessid

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Josh_1627 Profile Picture
    65 on at

    I have tried the below but getting the error

    PATCH url/.../teams(19e4893f)

    Body

    {

    "name":"testing",

           "_businessunitId_value@odata.bind" :"1E81E2CB"

    }

    error

    "An error occurred while validating input parameters: Microsoft.OData.ODataException: An undeclared property '_businessunitId_value' which only has property annotations in the payload but no property value was found in the payload. In OData, only declared navigation properties and declared named streams can be represented as properties without values.\r\n   at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadUndeclaredProperty

  • Verified answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    You don't need _field_value. Please see below for correct syntax

    Body

    {

    "name":"testing",

    "businessunitid@odata.bind" :"/businessunits(80c4ecda-4c5a-ec11-8f8f-002248d4e639)"

    }

    where 80c4ecda-4c5a-ec11-8f8f-002248d4e639 is the BU Record GUID.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Josh_1627 Profile Picture
    65 on at

    yes it worked :)

  • Bipin D365 Profile Picture
    28,985 Moderator on at

    Please mark my answer verified by clicking on Yes under Did this unser your question?

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello Josh,

    Please mark my answer verified. if it helped you to resolved your issue.

    By clicking on "Yes" under "Did this answer your question?"

    Thank you,

    Amit Katariya

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 170 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 155

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans