Urgent.News

What's breaking now, across thousands of outlets.

Tech

Dynamics 365 Finance OData Returns Only One Company: How to Read Them All

A sales report built on Dynamics 365 finance and operations data can look complete and still be missing most of the business. For Supply Chain Analytics teams at Aimpex Resources Group LLC, this is a problem worth catching early, because the numbers add up but only for one legal entity. What does the problem look like? A common report: a Power BI report pulls Dynamics 365 data, but the dataAreaId…

A sales report created using Dynamics 365 finance and operations data may appear complete but could be missing data from multiple companies. This issue affects Supply Chain Analytics teams at Aimpex Resources Group LLC, as the report only shows figures for a single legal entity. The problem arises when a Power BI report pulls data from Dynamics 365, where the dataAreaId column only displays one company. Implementing cross-company=true in the URL does not resolve the issue when using Implementation=2.0.

To understand why OData shows only one company, Microsoft states that by default, OData returns data only for the user's default company. Cross-company=true is a query option that allows the retrieval of data from all companies the user has access to. However, this option does not override security settings. Each data entity in Dynamics 365 has a PrimaryCompanyContext property; when set, it assigns a dataAreaId field to each row, linking it to a specific company.

In cases where this property is empty, the entity behaves like a shared table, containing data for all companies.

When requesting data for one or all companies, it is essential to include the cross-company=true option in the entity URL rather than the /data/ root. Microsoft's examples demonstrate this by using URLs like https://[baseURI]/data/FleetCustomers?cross-company=true or https://[baseURI]/data/FleetCustomers?$filter=dataAreaId eq [companyId] &cross-company=true. Replace the entity name and company ID with your system's specific values.

The list of public entities can be found at [Your organization's root URL]/data, while field names can be found in /data/$metadata. To pull data from Python, a scheduled extract for a data warehouse typically runs as an app rather than a user. To achieve this, an app registration in Microsoft Entra ID and a record under System administration > Setup > Microsoft Entra applications is required.

This app should map the client ID to a dedicated service account with appropriate permissions. Using MSAL (Microsoft's sign-in library for Python), the script can obtain a token, iterate through all pages, and count rows per company.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Building an Image-to-Pattern Editor Is Really a Grid Design Problem

I built MotifDraft to turn images into cross stitch, crochet, and bead charts. Users can edit colors and grids, then print a pattern. It starts free in the browser without an account.

  • MotifDraft converts images into patterns for crafts like cross stitch and crochet.
  • Core challenge lies in transforming images into editable grid format for physical projects.
  • Design focuses on structured data pattern, not just screenshot display.

A Simple Puzzle to learn Python Loops

problem : 1 Tenali Raman and the Palace Guards Tenali Raman wishes to meet the King. Before reaching the royal court, he has to pass through many palace gates. A guard is posted at each gate.

  • Tenali Raman starts with 1024 lashes
  • Each guard takes half of Raman's reward
  • Program tracks remaining lashes and guards

Building a BaZi Calculator: The Hard Part Is Explaining the Rules

I built BaZi Cue , a free calculator for BaZi’s Four Pillars, Day Master, and Five Elements. The interesting engineering problem isn’t drawing a chart.

  • Building BaZi calculator focuses on explaining rules, not design
  • Calculator requires calendar-dependent results with clear conventions
  • Input normalization and traceable derived values are crucial

More from Saturday 14 November →