Forum Discussion
Business Central with multiple companies duplicates data
Hi
After some testing we found that the connections are getting reused for some reason. So even thoug I would like to get G_L_Entry from diferent companies we got the first one. We realised that if we used then same environment name we god duplicates, but if we used different casing we got the correct data (so it looks so far). We used the below code to get the correct data. Looks like if we use different casing in all the connections they are treated as seperate connections. If we use the same case (e.g. PRODUCTION then it is treated as diffent queries.
Hope this helps - it seems to have solved our issue.
let
Source = Dynamics365BusinessCentral.EnvironmentContents("Production", "CompanyOne"),
G_LEntries_table = Source{[Name="G_LEntries",Signature="table"]}[Data]
let
Source = Dynamics365BusinessCentral.EnvironmentContents("pRoduction", "CompanyTwo"),
G_LEntries_table = Source{[Name="G_LEntries",Signature="table"]}[Data]
Hello,
I had the same issue and your solution solved the problem. It's a bit messy because I have many tables but I hope Power BI solves this problem soon.
Thank you, you saved me