update_dataverse_businessunit
Modify business unit information, contact details, addresses, and organizational settings in Microsoft Dataverse. Update specific fields like name, email, cost center, or location data for existing business units.
Instructions
Updates the properties and configuration of an existing business unit. Use this to modify business unit information, contact details, addresses, and organizational settings. Only provided fields will be updated.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address1_city | No | City name for address 1 | |
| address1_country | No | Country/region name for address 1 | |
| address1_county | No | County name for address 1 | |
| address1_fax | No | Fax number for address 1 | |
| address1_latitude | No | Latitude for address 1 | |
| address1_line1 | No | First line for address 1 | |
| address1_line2 | No | Second line for address 1 | |
| address1_line3 | No | Third line for address 1 | |
| address1_longitude | No | Longitude for address 1 | |
| address1_name | No | Name for address 1 | |
| address1_postalcode | No | ZIP Code or postal code for address 1 | |
| address1_postofficebox | No | Post office box number for address 1 | |
| address1_stateorprovince | No | State or province for address 1 | |
| address1_telephone1 | No | Main phone number for address 1 | |
| address1_telephone2 | No | Other phone number for address 1 | |
| address1_telephone3 | No | Third telephone number for address 1 | |
| address1_upszone | No | UPS zone for address 1 | |
| address1_utcoffset | No | UTC offset for address 1 | |
| address2_city | No | City name for address 2 | |
| address2_country | No | Country/region name for address 2 | |
| address2_county | No | County name for address 2 | |
| address2_fax | No | Fax number for address 2 | |
| address2_latitude | No | Latitude for address 2 | |
| address2_line1 | No | First line for address 2 | |
| address2_line2 | No | Second line for address 2 | |
| address2_line3 | No | Third line for address 2 | |
| address2_longitude | No | Longitude for address 2 | |
| address2_name | No | Name for address 2 | |
| address2_postalcode | No | ZIP Code or postal code for address 2 | |
| address2_postofficebox | No | Post office box number for address 2 | |
| address2_stateorprovince | No | State or province for address 2 | |
| address2_telephone1 | No | First telephone number for address 2 | |
| address2_telephone2 | No | Second telephone number for address 2 | |
| address2_telephone3 | No | Third telephone number for address 2 | |
| address2_upszone | No | UPS zone for address 2 | |
| address2_utcoffset | No | UTC offset for address 2 | |
| businessUnitId | Yes | Unique identifier of the business unit to update | |
| costCenter | No | Name of the business unit cost center | |
| creditLimit | No | Credit limit for the business unit | |
| description | No | Description of the business unit | |
| divisionName | No | Name of the division to which the business unit belongs | |
| emailAddress | No | Email address for the business unit | |
| fileAsName | No | Alternative name under which the business unit can be filed | |
| ftpSiteUrl | No | FTP site URL for the business unit | |
| isDisabled | No | Whether the business unit is disabled | |
| name | No | Name of the business unit | |
| stockExchange | No | Stock exchange on which the business is listed | |
| tickerSymbol | No | Stock exchange ticker symbol for the business unit | |
| webSiteUrl | No | Website URL for the business unit |
Implementation Reference
- src/tools/businessunit-tools.ts:274-365 (handler)Handler function that collects optional update fields from params, builds updateData object, and performs PATCH request to update the specified business unit via DataverseClient. Handles no-updates case and errors.async (params: any) => { try { const updateData: any = {}; // Add fields to update if provided if (params.name) updateData.name = params.name; if (params.description !== undefined) updateData.description = params.description; if (params.divisionName !== undefined) updateData.divisionname = params.divisionName; if (params.emailAddress !== undefined) updateData.emailaddress = params.emailAddress; if (params.costCenter !== undefined) updateData.costcenter = params.costCenter; if (params.creditLimit !== undefined) updateData.creditlimit = params.creditLimit; if (params.fileAsName !== undefined) updateData.fileasname = params.fileAsName; if (params.ftpSiteUrl !== undefined) updateData.ftpsiteurl = params.ftpSiteUrl; if (params.webSiteUrl !== undefined) updateData.websiteurl = params.webSiteUrl; if (params.stockExchange !== undefined) updateData.stockexchange = params.stockExchange; if (params.tickerSymbol !== undefined) updateData.tickersymbol = params.tickerSymbol; if (params.isDisabled !== undefined) updateData.isdisabled = params.isDisabled; // Add address 1 fields if (params.address1_name !== undefined) updateData.address1_name = params.address1_name; if (params.address1_line1 !== undefined) updateData.address1_line1 = params.address1_line1; if (params.address1_line2 !== undefined) updateData.address1_line2 = params.address1_line2; if (params.address1_line3 !== undefined) updateData.address1_line3 = params.address1_line3; if (params.address1_city !== undefined) updateData.address1_city = params.address1_city; if (params.address1_stateorprovince !== undefined) updateData.address1_stateorprovince = params.address1_stateorprovince; if (params.address1_postalcode !== undefined) updateData.address1_postalcode = params.address1_postalcode; if (params.address1_country !== undefined) updateData.address1_country = params.address1_country; if (params.address1_county !== undefined) updateData.address1_county = params.address1_county; if (params.address1_telephone1 !== undefined) updateData.address1_telephone1 = params.address1_telephone1; if (params.address1_telephone2 !== undefined) updateData.address1_telephone2 = params.address1_telephone2; if (params.address1_telephone3 !== undefined) updateData.address1_telephone3 = params.address1_telephone3; if (params.address1_fax !== undefined) updateData.address1_fax = params.address1_fax; if (params.address1_latitude !== undefined) updateData.address1_latitude = params.address1_latitude; if (params.address1_longitude !== undefined) updateData.address1_longitude = params.address1_longitude; if (params.address1_postofficebox !== undefined) updateData.address1_postofficebox = params.address1_postofficebox; if (params.address1_upszone !== undefined) updateData.address1_upszone = params.address1_upszone; if (params.address1_utcoffset !== undefined) updateData.address1_utcoffset = params.address1_utcoffset; // Add address 2 fields if (params.address2_name !== undefined) updateData.address2_name = params.address2_name; if (params.address2_line1 !== undefined) updateData.address2_line1 = params.address2_line1; if (params.address2_line2 !== undefined) updateData.address2_line2 = params.address2_line2; if (params.address2_line3 !== undefined) updateData.address2_line3 = params.address2_line3; if (params.address2_city !== undefined) updateData.address2_city = params.address2_city; if (params.address2_stateorprovince !== undefined) updateData.address2_stateorprovince = params.address2_stateorprovince; if (params.address2_postalcode !== undefined) updateData.address2_postalcode = params.address2_postalcode; if (params.address2_country !== undefined) updateData.address2_country = params.address2_country; if (params.address2_county !== undefined) updateData.address2_county = params.address2_county; if (params.address2_telephone1 !== undefined) updateData.address2_telephone1 = params.address2_telephone1; if (params.address2_telephone2 !== undefined) updateData.address2_telephone2 = params.address2_telephone2; if (params.address2_telephone3 !== undefined) updateData.address2_telephone3 = params.address2_telephone3; if (params.address2_fax !== undefined) updateData.address2_fax = params.address2_fax; if (params.address2_latitude !== undefined) updateData.address2_latitude = params.address2_latitude; if (params.address2_longitude !== undefined) updateData.address2_longitude = params.address2_longitude; if (params.address2_postofficebox !== undefined) updateData.address2_postofficebox = params.address2_postofficebox; if (params.address2_upszone !== undefined) updateData.address2_upszone = params.address2_upszone; if (params.address2_utcoffset !== undefined) updateData.address2_utcoffset = params.address2_utcoffset; if (Object.keys(updateData).length === 0) { return { content: [ { type: "text", text: "No fields provided to update" } ], isError: true }; } await client.patch(`businessunits(${params.businessUnitId})`, updateData); return { content: [ { type: "text", text: `Successfully updated business unit. Updated fields: ${Object.keys(updateData).join(', ')}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error updating business unit: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } }
- Zod input schema defining businessUnitId (required) and numerous optional fields for updating business unit properties, addresses (1 and 2), contact info, etc.inputSchema: { businessUnitId: z.string().describe("Unique identifier of the business unit to update"), name: z.string().min(1).max(160).optional().describe("Name of the business unit"), description: z.string().max(2000).optional().describe("Description of the business unit"), divisionName: z.string().max(100).optional().describe("Name of the division to which the business unit belongs"), emailAddress: z.string().email().max(100).optional().describe("Email address for the business unit"), costCenter: z.string().max(100).optional().describe("Name of the business unit cost center"), creditLimit: z.number().min(0).max(1000000000).optional().describe("Credit limit for the business unit"), fileAsName: z.string().max(100).optional().describe("Alternative name under which the business unit can be filed"), ftpSiteUrl: z.string().url().max(200).optional().describe("FTP site URL for the business unit"), webSiteUrl: z.string().url().max(200).optional().describe("Website URL for the business unit"), stockExchange: z.string().max(10).optional().describe("Stock exchange on which the business is listed"), tickerSymbol: z.string().max(10).optional().describe("Stock exchange ticker symbol for the business unit"), isDisabled: z.boolean().optional().describe("Whether the business unit is disabled"), // Address 1 fields address1_name: z.string().max(100).optional().describe("Name for address 1"), address1_line1: z.string().max(250).optional().describe("First line for address 1"), address1_line2: z.string().max(250).optional().describe("Second line for address 1"), address1_line3: z.string().max(250).optional().describe("Third line for address 1"), address1_city: z.string().max(80).optional().describe("City name for address 1"), address1_stateorprovince: z.string().max(50).optional().describe("State or province for address 1"), address1_postalcode: z.string().max(20).optional().describe("ZIP Code or postal code for address 1"), address1_country: z.string().max(80).optional().describe("Country/region name for address 1"), address1_county: z.string().max(50).optional().describe("County name for address 1"), address1_telephone1: z.string().max(50).optional().describe("Main phone number for address 1"), address1_telephone2: z.string().max(50).optional().describe("Other phone number for address 1"), address1_telephone3: z.string().max(50).optional().describe("Third telephone number for address 1"), address1_fax: z.string().max(50).optional().describe("Fax number for address 1"), address1_latitude: z.number().min(-90).max(90).optional().describe("Latitude for address 1"), address1_longitude: z.number().min(-180).max(180).optional().describe("Longitude for address 1"), address1_postofficebox: z.string().max(20).optional().describe("Post office box number for address 1"), address1_upszone: z.string().max(4).optional().describe("UPS zone for address 1"), address1_utcoffset: z.number().min(-1500).max(1500).optional().describe("UTC offset for address 1"), // Address 2 fields address2_name: z.string().max(100).optional().describe("Name for address 2"), address2_line1: z.string().max(250).optional().describe("First line for address 2"), address2_line2: z.string().max(250).optional().describe("Second line for address 2"), address2_line3: z.string().max(250).optional().describe("Third line for address 2"), address2_city: z.string().max(80).optional().describe("City name for address 2"), address2_stateorprovince: z.string().max(50).optional().describe("State or province for address 2"), address2_postalcode: z.string().max(20).optional().describe("ZIP Code or postal code for address 2"), address2_country: z.string().max(80).optional().describe("Country/region name for address 2"), address2_county: z.string().max(50).optional().describe("County name for address 2"), address2_telephone1: z.string().max(50).optional().describe("First telephone number for address 2"), address2_telephone2: z.string().max(50).optional().describe("Second telephone number for address 2"), address2_telephone3: z.string().max(50).optional().describe("Third telephone number for address 2"), address2_fax: z.string().max(50).optional().describe("Fax number for address 2"), address2_latitude: z.number().min(-90).max(90).optional().describe("Latitude for address 2"), address2_longitude: z.number().min(-180).max(180).optional().describe("Longitude for address 2"), address2_postofficebox: z.string().max(20).optional().describe("Post office box number for address 2"), address2_upszone: z.string().max(4).optional().describe("UPS zone for address 2"), address2_utcoffset: z.number().min(-1500).max(1500).optional().describe("UTC offset for address 2") }
- src/tools/businessunit-tools.ts:215-366 (registration)server.registerTool call within updateBusinessUnitTool function that defines and registers the tool with its name, metadata, schema, and inline handler.server.registerTool( "update_dataverse_businessunit", { title: "Update Dataverse Business Unit", description: "Updates the properties and configuration of an existing business unit. Use this to modify business unit information, contact details, addresses, and organizational settings. Only provided fields will be updated.", inputSchema: { businessUnitId: z.string().describe("Unique identifier of the business unit to update"), name: z.string().min(1).max(160).optional().describe("Name of the business unit"), description: z.string().max(2000).optional().describe("Description of the business unit"), divisionName: z.string().max(100).optional().describe("Name of the division to which the business unit belongs"), emailAddress: z.string().email().max(100).optional().describe("Email address for the business unit"), costCenter: z.string().max(100).optional().describe("Name of the business unit cost center"), creditLimit: z.number().min(0).max(1000000000).optional().describe("Credit limit for the business unit"), fileAsName: z.string().max(100).optional().describe("Alternative name under which the business unit can be filed"), ftpSiteUrl: z.string().url().max(200).optional().describe("FTP site URL for the business unit"), webSiteUrl: z.string().url().max(200).optional().describe("Website URL for the business unit"), stockExchange: z.string().max(10).optional().describe("Stock exchange on which the business is listed"), tickerSymbol: z.string().max(10).optional().describe("Stock exchange ticker symbol for the business unit"), isDisabled: z.boolean().optional().describe("Whether the business unit is disabled"), // Address 1 fields address1_name: z.string().max(100).optional().describe("Name for address 1"), address1_line1: z.string().max(250).optional().describe("First line for address 1"), address1_line2: z.string().max(250).optional().describe("Second line for address 1"), address1_line3: z.string().max(250).optional().describe("Third line for address 1"), address1_city: z.string().max(80).optional().describe("City name for address 1"), address1_stateorprovince: z.string().max(50).optional().describe("State or province for address 1"), address1_postalcode: z.string().max(20).optional().describe("ZIP Code or postal code for address 1"), address1_country: z.string().max(80).optional().describe("Country/region name for address 1"), address1_county: z.string().max(50).optional().describe("County name for address 1"), address1_telephone1: z.string().max(50).optional().describe("Main phone number for address 1"), address1_telephone2: z.string().max(50).optional().describe("Other phone number for address 1"), address1_telephone3: z.string().max(50).optional().describe("Third telephone number for address 1"), address1_fax: z.string().max(50).optional().describe("Fax number for address 1"), address1_latitude: z.number().min(-90).max(90).optional().describe("Latitude for address 1"), address1_longitude: z.number().min(-180).max(180).optional().describe("Longitude for address 1"), address1_postofficebox: z.string().max(20).optional().describe("Post office box number for address 1"), address1_upszone: z.string().max(4).optional().describe("UPS zone for address 1"), address1_utcoffset: z.number().min(-1500).max(1500).optional().describe("UTC offset for address 1"), // Address 2 fields address2_name: z.string().max(100).optional().describe("Name for address 2"), address2_line1: z.string().max(250).optional().describe("First line for address 2"), address2_line2: z.string().max(250).optional().describe("Second line for address 2"), address2_line3: z.string().max(250).optional().describe("Third line for address 2"), address2_city: z.string().max(80).optional().describe("City name for address 2"), address2_stateorprovince: z.string().max(50).optional().describe("State or province for address 2"), address2_postalcode: z.string().max(20).optional().describe("ZIP Code or postal code for address 2"), address2_country: z.string().max(80).optional().describe("Country/region name for address 2"), address2_county: z.string().max(50).optional().describe("County name for address 2"), address2_telephone1: z.string().max(50).optional().describe("First telephone number for address 2"), address2_telephone2: z.string().max(50).optional().describe("Second telephone number for address 2"), address2_telephone3: z.string().max(50).optional().describe("Third telephone number for address 2"), address2_fax: z.string().max(50).optional().describe("Fax number for address 2"), address2_latitude: z.number().min(-90).max(90).optional().describe("Latitude for address 2"), address2_longitude: z.number().min(-180).max(180).optional().describe("Longitude for address 2"), address2_postofficebox: z.string().max(20).optional().describe("Post office box number for address 2"), address2_upszone: z.string().max(4).optional().describe("UPS zone for address 2"), address2_utcoffset: z.number().min(-1500).max(1500).optional().describe("UTC offset for address 2") } }, async (params: any) => { try { const updateData: any = {}; // Add fields to update if provided if (params.name) updateData.name = params.name; if (params.description !== undefined) updateData.description = params.description; if (params.divisionName !== undefined) updateData.divisionname = params.divisionName; if (params.emailAddress !== undefined) updateData.emailaddress = params.emailAddress; if (params.costCenter !== undefined) updateData.costcenter = params.costCenter; if (params.creditLimit !== undefined) updateData.creditlimit = params.creditLimit; if (params.fileAsName !== undefined) updateData.fileasname = params.fileAsName; if (params.ftpSiteUrl !== undefined) updateData.ftpsiteurl = params.ftpSiteUrl; if (params.webSiteUrl !== undefined) updateData.websiteurl = params.webSiteUrl; if (params.stockExchange !== undefined) updateData.stockexchange = params.stockExchange; if (params.tickerSymbol !== undefined) updateData.tickersymbol = params.tickerSymbol; if (params.isDisabled !== undefined) updateData.isdisabled = params.isDisabled; // Add address 1 fields if (params.address1_name !== undefined) updateData.address1_name = params.address1_name; if (params.address1_line1 !== undefined) updateData.address1_line1 = params.address1_line1; if (params.address1_line2 !== undefined) updateData.address1_line2 = params.address1_line2; if (params.address1_line3 !== undefined) updateData.address1_line3 = params.address1_line3; if (params.address1_city !== undefined) updateData.address1_city = params.address1_city; if (params.address1_stateorprovince !== undefined) updateData.address1_stateorprovince = params.address1_stateorprovince; if (params.address1_postalcode !== undefined) updateData.address1_postalcode = params.address1_postalcode; if (params.address1_country !== undefined) updateData.address1_country = params.address1_country; if (params.address1_county !== undefined) updateData.address1_county = params.address1_county; if (params.address1_telephone1 !== undefined) updateData.address1_telephone1 = params.address1_telephone1; if (params.address1_telephone2 !== undefined) updateData.address1_telephone2 = params.address1_telephone2; if (params.address1_telephone3 !== undefined) updateData.address1_telephone3 = params.address1_telephone3; if (params.address1_fax !== undefined) updateData.address1_fax = params.address1_fax; if (params.address1_latitude !== undefined) updateData.address1_latitude = params.address1_latitude; if (params.address1_longitude !== undefined) updateData.address1_longitude = params.address1_longitude; if (params.address1_postofficebox !== undefined) updateData.address1_postofficebox = params.address1_postofficebox; if (params.address1_upszone !== undefined) updateData.address1_upszone = params.address1_upszone; if (params.address1_utcoffset !== undefined) updateData.address1_utcoffset = params.address1_utcoffset; // Add address 2 fields if (params.address2_name !== undefined) updateData.address2_name = params.address2_name; if (params.address2_line1 !== undefined) updateData.address2_line1 = params.address2_line1; if (params.address2_line2 !== undefined) updateData.address2_line2 = params.address2_line2; if (params.address2_line3 !== undefined) updateData.address2_line3 = params.address2_line3; if (params.address2_city !== undefined) updateData.address2_city = params.address2_city; if (params.address2_stateorprovince !== undefined) updateData.address2_stateorprovince = params.address2_stateorprovince; if (params.address2_postalcode !== undefined) updateData.address2_postalcode = params.address2_postalcode; if (params.address2_country !== undefined) updateData.address2_country = params.address2_country; if (params.address2_county !== undefined) updateData.address2_county = params.address2_county; if (params.address2_telephone1 !== undefined) updateData.address2_telephone1 = params.address2_telephone1; if (params.address2_telephone2 !== undefined) updateData.address2_telephone2 = params.address2_telephone2; if (params.address2_telephone3 !== undefined) updateData.address2_telephone3 = params.address2_telephone3; if (params.address2_fax !== undefined) updateData.address2_fax = params.address2_fax; if (params.address2_latitude !== undefined) updateData.address2_latitude = params.address2_latitude; if (params.address2_longitude !== undefined) updateData.address2_longitude = params.address2_longitude; if (params.address2_postofficebox !== undefined) updateData.address2_postofficebox = params.address2_postofficebox; if (params.address2_upszone !== undefined) updateData.address2_upszone = params.address2_upszone; if (params.address2_utcoffset !== undefined) updateData.address2_utcoffset = params.address2_utcoffset; if (Object.keys(updateData).length === 0) { return { content: [ { type: "text", text: "No fields provided to update" } ], isError: true }; } await client.patch(`businessunits(${params.businessUnitId})`, updateData); return { content: [ { type: "text", text: `Successfully updated business unit. Updated fields: ${Object.keys(updateData).join(', ')}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error updating business unit: ${error instanceof Error ? error.message : 'Unknown error'}` } ], isError: true }; } } );
- src/index.ts:214-214 (registration)Invocation of updateBusinessUnitTool in main server setup, which triggers the registration of the update_dataverse_businessunit tool.updateBusinessUnitTool(server, dataverseClient);