How to create a dataverse virtual table for Business central

355 Views Asked by At

What's the best way to connect Business Central to Power Pages? I've tried virtual tables so far, however, I am not able to see the data when I create a list view or a form in Power pages. It is returning the following error 'We're sorry, but something went wrong. Please try again, and if this persists, contact the website administrator.'.

Does anyone know how to solve this issue? Should I keep using virtual tables or is there a better way?

Thanks in advance.

1

There are 1 best solutions below

0
On

Not sure about Power Pages, I don't think there is a way to show a Power Page in BC other than embedding a web browser control into a BC page. But if the question is about reading Dataverse tables from BC, then virtual tables are the right way to do it. First, you need to create a table object in BC using the AL Table Proxy Generator as described in the docs: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-custom-cds-integration

Then you can create a page based on this table or read data from Dataverse in AL, just note that before querying a Dataverse proxy table, your code must register the connection. Call the method RegisterConnection from the codeunit CDS Integration Mgt. before running the page or executing any Find*/Get statement in AL.