Starting from version 2023 you can now use web view panels.
The web view panel is a special type of panel allowing you to show an external website or a service.
Inside the web client. As a part of its layout.
Maybe this reminds you of the web browser panel in the ERP.net Desktop Client?
And there's a reason for that.
It's essentially the same functionality. You can embed external web content (from a web page or web service) directly in the web client.
Use cases
You can visualize a Power BI report directly in your web client.
Or some particular documentation page that you use quite often:
Or why not a web service?
More than a single web view at once? Sure, here they're. Configured in the dashboard.
Finally, an external (web) application, based on some context:
Here you can see - the web view is placed inside a sales order form and embeds an external application that displays additional information to the current document.
One moment... current document? How so?
Easy- the web view URL accepts an interpolated string. Actually it is an interpolated string.
String interpolation
Just like in the Desktop Client, you can specify the URL of the web view as an interpolated string.
This way you can associate it with the context in which the web view is located.
Like in the "sales order example" above. We use the following URL:
https://externalapp.com/SalesOrder/{Id}
So when the interpolated string is evaluated, the {Id} expression will be replaced with the actual Id of the sales order.
Also, instead of typing the interpolated string manually, you can always use our dedicated tool- the string interpolation builder.
Remarks
Internally, the web view presents its content via an <iframe/>.
This means that there're some limitations:
- The website (or service) you want to display in a web view must allow this.
This is controlled by the X-Frame-Options HTTP response header, and if set to DENY or SAMEORIGIN, the web view won't be able to visualize it.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
- The website (or service) requires authentication, managed by authentication cookies which are restricted to a first-party or same-site context.
This means that the external website should explicitly set that the auth cookies will be sent in cross-site requests.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite - If this is an external application, using ERP.net Identity Site for authentication, the Id site must be the same one, as for ERP.net Web Client.
The reason is simple. Actually, this is the same as the previous limitation. ERP.net Identity Site's cookies are restricted to the same-site context.
---
More information is available in our official documentation:
https://docs.erp.net/webclient/introduction/my-apps/web-view.html
https://support.erp.net/hc/en-us/articles/7340615341596
https://docs.erp.net/tech/advanced/string-interpolation/index.html
0 Comments