{"id":28937,"date":"2021-08-11T10:21:15","date_gmt":"2021-08-11T10:21:15","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=28937"},"modified":"2021-10-07T11:37:15","modified_gmt":"2021-10-07T06:07:15","slug":"custom-pages-a-step-towards-disappearing-lines-between-canvas-apps-and-model-driven-apps-in-power-platform-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/08\/custom-pages-a-step-towards-disappearing-lines-between-canvas-apps-and-model-driven-apps-in-power-platform-dynamics-365-crm\/","title":{"rendered":"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM"},"content":{"rendered":"<p style=\"text-align: justify;\">Power Apps provides support for 2 types of design experience for Apps.<\/p>\n<p style=\"text-align: justify;\">Model-driven apps \u2013 Data first approach \u2013 more for backend end user with full form experience.<\/p>\n<p style=\"text-align: justify;\">Canvas Apps \u2013 Design first approach \u2013 more for the field users with a mobile experience with simple to use and easily accessible apps being designed to serve specific purpose.<\/p>\n<p style=\"text-align: justify;\">Traditionally these have been aligned as Model-driven apps for web experience with full support for pro-dev extensions and Canvas Apps for citizen developers to design using low-code expression language now branded as Power Fx.<\/p>\n<p style=\"text-align: justify;\">Custom pages is the next big step in the journey to unify the app experience and enable the developers and designer to combine the best of both worlds to give a seamless user experience to the end users without they having to worry about the technology being used and wait a second\u2026 they do not have to worry about the licensing as well.<\/p>\n<p style=\"text-align: justify;\">Read <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/model-driven-apps\/model-app-page-overview#frequently-asked-questions\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>, canvas apps designed as pages do not count towards app limits.<\/p>\n<p style=\"text-align: justify;\">With one of the earlier updates, we are allowed to embed Canvas apps within a model-driven form. But with Custom pages we will now be able to take advantage of Canvas app designers to build quick ui solutions that we can surface within model driven apps as;<\/p>\n<ol style=\"text-align: justify;\">\n<li>\u00a0Standalone pages in sitemap \u2013 app navigation in the new app designer now supports adding Custom Page to navigation.<\/li>\n<li>Call them from the context of a form through client api like a popup dialog from a ribbon button on a form or home grid as an example.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Let us have a quick look at each of these options.<\/p>\n<h2 style=\"text-align: justify;\"><strong><u>Standalone page in App navigation:<\/u><\/strong><\/h2>\n<p style=\"text-align: justify;\">To add a custom page, we need to go through the new app designer experience that is currently in preview and choose the Custom option.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28938 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1800\" height=\"1148\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11.png 1800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11-300x191.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11-768x490.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11-1024x653.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-11-660x421.png 660w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Next either choose an existing page if you have already designed one or create a new one.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28939 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1800\" height=\"1148\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9.png 1800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9-300x191.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9-768x490.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9-1024x653.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-9-660x421.png 660w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><em>Note: Since it talks Canvas apps I thought \u201cuse an existing custom page\u201d would show me a list of all my existing canvas apps from my previous work and allow me to quickly add one of those and get going\u2026 BUT canvas apps are not custom pages \u2013 custom page is a new component type though it uses Canvas designer for designing it is not a canvas app and it won\u2019t even be listed as an APP in your app listing.<\/em><\/p>\n<p style=\"text-align: justify;\"><em>Currently there seems no way to use existing canvas apps as is in this screen here. Check out the recommended <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/model-driven-apps\/model-app-page-overview#migrating-standalone-canvas-app-content-to-custom-pages\" target=\"_blank\" rel=\"noopener noreferrer\">way<\/a> shared by the product team to get them migrated.<\/em><\/p>\n<p style=\"text-align: justify;\">If you would like to include this as a standalone page in sitemap then check Show in navigation. Once you click Add, the very familiar Canvas App Designer shows up for you to go ahead and build your app.<\/p>\n<p style=\"text-align: justify;\">For this exercise I added a gallery component with Contacts listed in there.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28941 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2368\" height=\"1148\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6.png 2368w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6-300x145.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6-768x372.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6-1024x496.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-6-660x320.png 660w\" sizes=\"(max-width: 2368px) 100vw, 2368px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">With very minimal effort, we are now able to add visually appealing listing with images. Before Custom pages, this would perhaps have to be a Power Apps Component Framework Control requiring substantial efforts to develop.<\/p>\n<p style=\"text-align: justify;\">Save and publish this app from the canvas designer and click back to navigate back to the app designer to see this added to the navigation.<\/p>\n<p style=\"text-align: justify;\"><strong><em>Make sure to publish the App to see the preview for the page.<\/em><\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28942 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2774\" height=\"1148\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3.png 2774w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3-300x124.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3-768x318.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3-1024x424.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-3-660x273.png 660w\" sizes=\"(max-width: 2774px) 100vw, 2774px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">And that is all it takes to converge a canvas app with a model driven app!<\/p>\n<p style=\"text-align: justify;\">Have a look at your solution and you will see this listed as a Page and not a Canvas App.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28943 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1866\" height=\"888\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3.png 1866w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3-300x143.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3-768x365.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3-1024x487.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-3-660x314.png 660w\" sizes=\"(max-width: 1866px) 100vw, 1866px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong><u>Calling a custom page from a ribbon button<\/u><\/strong><\/p>\n<p style=\"text-align: justify;\">Note, you need to first have a page component created. You now have the option of adding a new page in the Add new option within a solution.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28944 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1644\" height=\"328\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1.png 1644w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1-300x60.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1-768x153.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1-1024x204.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-2-1-660x132.png 660w\" sizes=\"(max-width: 1644px) 100vw, 1644px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">For this example, we will create an unbound screen to accept notification types from the user as shown below:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28945 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1690\" height=\"974\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1.png 1690w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1-300x173.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1-768x443.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1-1024x590.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-1-1-660x380.png 660w\" sizes=\"(max-width: 1690px) 100vw, 1690px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">These controls have simply been arranged on the canvas. No further code is added to any control here.<\/p>\n<p style=\"text-align: justify;\">Now let us modify the text for the record label to instead show the name of the record that this button was invoked for.<\/p>\n<p style=\"text-align: justify;\">In the App -&gt; OnStart event type the following code:<\/p>\n<p>Set(RecordId, Param(&#8220;recordId&#8221;));<br \/>\nSet (selectedRecord, LookUp(Accounts, Account = GUID(RecordId)));<br \/>\nNotify(RecordId);<\/p>\n<p style=\"text-align: justify;\">Param(\u201crecordId\u201d) is a parameter that we will pass to this page when invoking it from the ribbon button from model driven app. This will be the recordId of the selected record from the home grid.<\/p>\n<p style=\"text-align: justify;\">LookUp(Accounts, Account = GUID(RecordId))<br \/>\nHere we search for an account in the database with same recordid as the parameter received.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28946 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2022\" height=\"652\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2.png 2022w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2-300x97.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2-768x248.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2-1024x330.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-1-2-660x213.png 660w\" sizes=\"(max-width: 2022px) 100vw, 2022px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Now modify the text property of the record label added to the canvas to show the name of the account retrieved using the recordId passed as parameter.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28947 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2022\" height=\"572\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5.png 2022w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5-300x85.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5-768x217.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5-1024x290.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-5-660x187.png 660w\" sizes=\"(max-width: 2022px) 100vw, 2022px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">With this, page design is complete, let us save and publish this page and return to the solution explorer.<\/p>\n<p style=\"text-align: justify;\"><strong><em>Note: Make sure to also publish the app each time you edit the page, I noticed the page throws an error until the app is published and then you re-open the app editor.<\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">Go back to App designer and show the Edit in preview option to use the new designer interface.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28949 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2022\" height=\"572\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1.png 2022w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1-300x85.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1-768x217.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1-1024x290.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image019-ink-2-1-660x187.png 660w\" sizes=\"(max-width: 2022px) 100vw, 2022px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Choose edit command bar for the account entity.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28950 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2.png\" alt=\"\" width=\"2022\" height=\"572\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2.png 2022w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2-300x85.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2-768x217.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2-1024x290.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image021-ink-1-2-660x187.png 660w\" sizes=\"(max-width: 2022px) 100vw, 2022px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Here, choose main grid that\u2019s where we will add the button.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28951 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1780\" height=\"572\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1.png 1780w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1-300x96.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1-768x247.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1-1024x329.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image023-ink-1-1-660x212.png 660w\" sizes=\"(max-width: 1780px) 100vw, 1780px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Add + New Command.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28952 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"2874\" height=\"800\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1.png 2874w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1-300x84.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1-768x214.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1-1024x285.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image025-ink-1-1-660x184.png 660w\" sizes=\"(max-width: 2874px) 100vw, 2874px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>\u00a0<\/strong>Since we would like this button to show up only when one record from the grid is selected we write <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/model-driven-apps\/commanding-use-powerfx#patch-the-current-selected-record\" target=\"_blank\" rel=\"noopener noreferrer\">Power Fx expression<\/a> in the Visible property as shown above.<\/p>\n<p style=\"text-align: justify;\">Next to show the page on the click of the button, we need to call a javascript function. Choose Run JavaScript for the Action property and select the javascript library with the code.<\/p>\n<p style=\"text-align: justify;\">Type in the function name to execute from the library and in our case, we also pass the parameter which is id of selected records from the grid.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image027-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28953 \" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image027-ink-420x1024.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"274\" height=\"668\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image027-ink-420x1024.png 420w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image027-ink-123x300.png 123w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image027-ink.png 544w\" sizes=\"(max-width: 274px) 100vw, 274px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Here is what the showCanvas function looks like;<\/p>\n<pre class=\"lang:css gutter:true start:1\">function showCanvas(id)\r\n{\r\nalert(\"in here\");\r\nalert(\"text \" + id);\r\n\/\/set the pageType as custom, to call a custom page that we just created\r\n\/\/ name is the logical name of the page you can pick this up from solution explorer\r\nvar pageInput = {\r\npageType: \"custom\",\r\nname: \"rooh_querydialog_bd7bb\",\r\nentityName: \"account\",\r\nrecordId: id\r\n};\r\n\/\/target = 2 is for dialog\r\n\/\/position = 1 is for center dialog\r\nvar navigationOptions = {\r\ntarget: 2,\r\nposition: 1,\r\ntitle: \"Notification\"\r\n};\r\nXrm.Navigation.navigateTo(pageInput, navigationOptions).then(\r\nfunction success() {\r\n\/\/ Run code on success\r\nalert(\"loaded\");\r\n},\r\nfunction error() {\r\n\/\/ Handle errors\r\nalert(\"error\");\r\n})\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\">Here is where you can pick up the logical name of the page you just created.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28955 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink.png\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1674\" height=\"774\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink.png 1674w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink-300x139.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink-768x355.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink-1024x473.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image029-ink-660x305.png 660w\" sizes=\"(max-width: 1674px) 100vw, 1674px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong><em>It doesn\u2019t allow you to copy the name so be careful when typing out the name.<\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">Save and publish the command bar and click Play to preview.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image031.gif\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-28956 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image031.gif\" alt=\"Custom Pages: A step towards disappearing lines between Canvas Apps and Model Driven Apps in Power Platform \/ Dynamics 365 CRM\" width=\"1440\" height=\"810\" \/><\/a>Note that while we can pass context information as parameters from the model driven app to the custom page, we are not able to pass any information back to the model driven app from the custom page. In the above example, there isn\u2019t a way to return information of the selection made by the user on the custom page.<\/p>\n<p style=\"text-align: justify;\">Alternate method could certainly be to update a field of the record using the <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/model-driven-apps\/commanding-use-powerfx#patch-the-current-selected-record\">Patch()<\/a> from within the custom page on the OK or Cancel button click.<\/p>\n<p style=\"text-align: justify;\">Being a canvas app, you can now also invoke a flow from the buttons on the custom page to process the selection further.<\/p>\n<p>Conclusion: Custom pages would certainly help with many of the UI scenarios that have traditionally required developing custom web resources or pcf controls and with license considerations out of the picture, it would make adoption of this one a lot easier.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.maplytics.com\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"wp-image-28845 size-full aligncenter\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/1.jpg\" alt=\"Maplytics\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/1.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/1-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/1-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/1-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Apps provides support for 2 types of design experience for Apps. Model-driven apps \u2013 Data first approach \u2013 more for backend end user with full form experience. Canvas Apps \u2013 Design first approach \u2013 more for the field users with a mobile experience with simple to use and easily accessible apps being designed to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/08\/custom-pages-a-step-towards-disappearing-lines-between-canvas-apps-and-model-driven-apps-in-power-platform-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1954,1913],"tags":[1195,1351],"class_list":["post-28937","post","type-post","status-publish","format-standard","hentry","category-canvas-apps","category-microsoft-power-platform-services","tag-model-driven-app-dynamics-crm-365","tag-power-platform"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=28937"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/28937\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=28937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=28937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=28937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}