Business Central share analyse views

Business Central analyse views have been a game changer for the product! There is now a sharing experience available too:

If you look at the URL the “Copy” feature produces it is much like below (this example is without the company value):
https://businesscentral.dynamics.com/<YourTenantID>/Production/do?page=20&dc=0&bookmark=C_EQAAAACH1g#open-analysisview=H4sIAAAAAAAAA-XZW2_aMBQA4Hd-hf8AjEsvW94YtIhq3brS9RUZ50AsJXZmH4-iaf99JtOoCWFoqorKyWNObv5yfDuK4hlEbCKzPAV2J39obEg7cMaAwkcJy4ihcdAQOnWZmiBHiBqMNZkPjOOI3WmLUi3Y0J_wccaWMsYkYp1Ot3VeBBIZ-xfMeWr_XJBLpcDfqVyaFgGrDZYOxyqGpyDGF4trp0QQMXo5Mtrl4ZP_xsp352vVdhN8oHzVPA0OK33TFXATIrvtdkAsvtOJC787bhBegORWvHVjphUm-4UHe-qrE4Nv_Cxs_4M31MJlfryyh1VOchRugJ91a8v3gYJu9O4T6wuh3Rrop-NQ2OsdZYrZPLjka78Y95GnrWddKX3dSxLdcyuBNIlD6ceflVqxCSAbD0kawQojc_TKreXhgsYkOkr1jKdBJjtsoGOgmMkdapcuFVRrs7-huv5_dVyhxNWWrUdB1s_Wq8aru6zLjjyVziQeC3f0pA0MxIR5j_0Hdg-5bxPlyn5XSbO-r3ASrfIrpAdq_dN0Xik0q51Cg8iwvHryPVOtN2_7an4i0Il2RgDZfek3C6ZcJ54RyVzimyMcBvVFj2weK7BndcKe1wl7cRB7opugCutljazvqVr5ojkyMm72HepB8YsyRP7nj503aiwune7-wprecOU38qsp1Tp0L_waZqae8ltuRFI_9o1TUD913y2cxfq5J5AjZDMw9aN_EajJwYvzt3qzzZjL1Nf4NmI_fzV-A16suil_JAAA&zip=1&base64=1&title=General+Ledger+Entries+-+56100+Sales+VAT+20+%25+-+Simple+Pivot+%28%F0%9F%A7%AA%F0%9F%A7%BC%F0%9F%A7%BD%29

Which in turn got me thinking could I have a generic set of analyse views that I could just deploy into different customer environments as I need? I’m sure a Gen AI facility will eventually exist for spinning up required analyse views. But in the instance you have created something for one customer/company, you might want to drop that into other environments. So what happens if I replace the tenant ID in the copied URL will another one?…………………………….A continuous loop ➿😠

What can we do about that? Well if you edit the URL string slightly you get the desired results. Let’s use our example from earlier, but a reduced version:

https://businesscentral.dynamics.com/<YourTenantID>/Production/do?page=20&dc=0&bookmark=C_EQAAAACH1g#open-analysisview

If you remove the highlighted green parts of the string to give you:
https://businesscentral.dynamics.com/<YourTenantID>/do?page=20&dc=0#open-analysisview

Combine that with the rest of the URL string and you will get:

But wait that’s not the same? Where is the “Row Group” of G/L Account Name? This is how you can tell it is another database or tenant. That field has been added to the page through page customisation. Simply add it to the page and redo the process to get the desired result:

But wait isn’t there a resource on GitHub for all of this already Josh? Why yes there is as it happens: https://github.com/microsoft/BCTech/tree/master/samples/AnalyzeData

But, be warned that the URL’s might need some trimming to get them working as you would like. This is what happens if I just click the links πŸ™ˆ:

But if you follow the same idea I said earlier you get the desired result:

Happy sharing πŸ€—