Views:

Applies to Product - Dynamics 365 Commerce
 

What’s happening?
A data service client/Entra ID app user needs to change its own default company to access data from different entities, particularly when dealing with a custom entity that does not support cross-company queries.
 

Reason:
The custom entity in question does not correctly support the cross-company parameter on queries, necessitating a change in the default company for the user to retrieve the required data.
 

Resolution:

  • It is possible to update the company field of the SystemUsers entity using data services.
  • The user can perform the following steps:
  • Use an HTTP PATCH request to change the default company to the desired company (e.g., Company AAA).
  • Execute an HTTP GET request to retrieve the data from the custom entity for the newly set default company.
  • Repeat the process by sending another HTTP PATCH request to change the default company to another company (e.g., Company BBB).
  • Execute another HTTP GET request to retrieve the data for the second company from the custom entity.
  • Ensure that the requests are made in series to avoid conflicts.