How to combine Power Pages and Business Central
When writing this blog post the feature is still in public preview.
For a long time there was already the possibility to get your data from Business Central into Dataverse through Virtual Tables. That was working with Power Apps but with Power Pages you get an error when you add a virtual table inside your website. But with the start of Business Central 23.1 it is possible!
It was possible with the sync method described here:
Business Central and the Power of Power Pages – Discover Microsoft Business Central (bertverbeek.nl)
But that wasn’t easy. With Virtual Tables option it is very easy to expose your data.
What are Virtual Tables?
Virtual tables inside Dataverse is a table that doesn’t hold any data. It is just a look through to Business Central:
Microsoft Power Platform integration with Business Central via virtual tables – Business Central | Microsoft Learn
And it works like this:
How to setup the virtual tables you can find here:
Business Central Virtual Table for Microsoft Dataverse admin reference – Business Central | Microsoft Learn
Setup inside Business Central
Before you start you have to enable the “Microsoft Entra Applications”. There are two applications for Power Pages:
One is for the anonymous access and one for the verified users. You have to enable the application and also assign permissions to it.
The anonymous access can only read data! Even if you have set right permissions. If you modify a record with anonymous access in Power Pages you get an “unknow error”. In the logs you can see that you don’t have access:
Inside Power Pages
Inside Power Pages you can easily create a list and attach that to the Virtual Table (in this case the vendor table):
And if you preview the website it looks like this:
And if you want to edit the records you have to go to the “Portal Management App”:
There you can set the “Query string”:
In this when you click on a record in the list you get the ID of that record in the URL.
After this you need to create a form:
And set if you want to update or create new records:
Also here in the “Portal Management App” you have set two settings:
At last you have to set the permissions for that table:
Even if you set here the “Anonymous Users” to “Update” and “Create” you still got the following error when you submit the form:
But when you Sign into the site with your Microsoft Entry ID or a verified users you can change the record and it will also change the record in Business Central:
After submit you will get:
And in Business Central:
So with this you can create websites based on Power Pages and expose your Business Central data. And even change your Business Central data.
Again a great possibly to extend your customers need!
The Microsoft documentation:
Power Pages on virtual tables – Business Central | Microsoft Learn
3 COMMENTS