Controls https://dynamics-chronicles.com/ en Power Apps Code Apps in Practice: Recreating Model-Driven App Patterns https://dynamics-chronicles.com/article/power-apps-code-apps-practice-recreating-model-driven-app-patterns <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Power Apps Code Apps in Practice: Recreating Model-Driven App Patterns</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/axel" lang="" about="/user/axel" typeof="schema:Person" property="schema:name" datatype="" class="username">Axel</a></span> <span property="schema:dateCreated" content="2026-03-11T14:56:40+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 03/11/2026 - 15:56</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h2></h2> <p>Power Apps Code Apps went from preview to general availability in record time. With that, Microsoft has sent a clear signal that it is taking this technology very seriously.</p> <p>In fact, Code Apps are something of a small revolution. They allow pro-code developers to deliver custom web apps directly within a Dataverse environment without the need to implement authentication libraries.</p> <p>But that is not all: Low-code developers can benefit from them as well. With tools like GitHub Copilot and Claude Code, you no longer necessarily need to understand a programming language such as React in order to build full-blown web application. Instead, you can simply describe the features you want in a prompt and have them implemented.</p> <p>This will fundamentally change the way how apps will be implemented in the future. <a href="https://storybooks.fluentui.dev/react">React Fluent UI components</a> can be integrated into Code Apps and open up entirely new possibilities for designing user interfaces such as accordions, cards or TreeViews.</p> <h2>Motivation</h2> <p>There is, however, one important point to consider: At the time of writing, Power Apps Code Apps are stand-alone apps. That means they are not integrated into a model-driven app, but exist as independent applications, similar to canvas apps. There is also no custom page in a model-driven app to represent a code app.</p> <p>But what if you still need the typical built-in functionality of a model-driven app upfront, such as filtering records in a data grid? One option would be to add a button to the model-driven app or try to integrate the app through an iframe.</p> <p>This article explores another approach: recreating typical model-driven app functionality directly inside the custom app. The goal is to assess how much effort this requires and how quickly something like this can be implemented, <strong>not to reinvent the wheel, but to demonstrate the capabilities and the power of Code Apps. </strong>And of course also to show that, for many use cases, you no longer need a model-driven app as the entry point.</p> <h2>PoC: Table Browser App</h2> <p>The goal was to build an new code app "Table Browser" from scratch which demonstrates that a standalone Power Apps Code App can reproduce familiar Model-Driven-App-style functionality, such as filtered and searchable record lists with the same look and feel like Model-Driven-Apps. This can serve as an entry point and opens the door to building a fully fledged standalone app with a much richer user experience, including features such as tree views and other advanced interface patterns that are difficult to realize in a traditional Model-Driven App.</p> <p>It is also a <strong>proof of concept</strong>: each feature was chosen to answer a specific question about what Code Apps can do. A secondary goal was to evaluate these two tools in a real-world scenario and gain hands-on experience with AI-assisted development.</p> <p><strong>The entire app was built in a single Saturday</strong> — using both <strong>GitHub Copilot</strong> and <strong>Claude Code</strong> as AI coding assistants. Fun fact: Claude Code estimated the development effort for the entire app at 12 to 15 days if implemented by a senior developer without the help of AI.</p> <p><img alt="Screenshots Table Browser App" data-entity-type="file" data-entity-uuid="db68f02b-3641-4694-afb2-2c9bd8b91f85" src="/sites/default/files/inline-images/TableBrowser.png" /></p> <p> </p> <p></p> <h3>Proof Points</h3> <ul> <li><strong>Performance</strong>: Can a Code App render large Dataverse record sets noticeably faster than a Model-Driven grid? Yes.</li> <li><strong>Infinite scroll</strong>: How much code does it take to implement demand-driven pagination? Very little — a scroll event plus a <code>getAll</code> call with <code>top</code> and <code>skip</code>.</li> <li><strong>Metadata access</strong>: How easy is it to read column metadata at runtime? One SDK call to <code>retrieveMultipleRecordsAsync</code> on <code>EntityDefinition</code> gives you full attribute detail.</li> <li><strong>View definitions</strong>: Can a Code App read the default system view and use it to determine which columns to show? Yes — <code>savedquery</code> records expose the column layout as XML, which the app parses to build its default column set.</li> <li><strong>Form definitions</strong>: Can a Code App reconstruct the default form layout — tabs, sections, fields — without hardcoding it? Yes — <code>systemform</code> records contain the full form structure as JSON and XML, which the app uses to render the record detail dialog.</li> <li><strong>Column persistence</strong>: Can user preferences be stored in Dataverse instead of localStorage — cross-device, without a custom table? Yes, via personal views (<code>userquery</code>).</li> </ul> <p></p> <h3>Key capabilities</h3> <ul> <li>Browse records from multiple Dataverse tables with infinite scroll and client-side search</li> <li>Inspect column metadata and field properties (schema view)</li> <li>Customize visible columns per table — persisted as personal views (<code>userquery</code> records) in Dataverse</li> <li>View full record details in a form-based dialog with tabs and sections</li> <li>Switch between list (DataGrid) and card grid layouts</li> <li>Light/dark mode, display density, and accent color theming (persisted to localStorage)</li> </ul> <h3>UI Features</h3> <p>The goal was to implement the same look and feel that we know from Model-Driven-App. This can easily be achieved by using the  <a href="https://storybooks.fluentui.dev/react">React Fluent UI components</a> library. The following chapters show which features have been implemented. </p> <h4>List View</h4> <img alt="List View" data-entity-type="file" data-entity-uuid="597a8d02-4260-4b33-979d-5f83a837e491" src="/sites/default/files/inline-images/Accounts-List-800x600_0.png" class="align-center" /> <p> </p> <ul> <li>The app uses the metadata to look for the default view of the table and shows all columns defined there.</li> <li>Columns width can be changed by drag and drop.</li> <li>Columns can be sorted. If sorted, an api call is used for server side sorting</li> <li>Smooth paging: Scrolling to the end of the list reloads the next page of data (e.g. the next 50 records)</li> </ul> <p> </p> <h4>Search and highlighting</h4> <img alt="Search Highlighting" data-entity-type="file" data-entity-uuid="95b7edfa-b8c9-492c-b6c1-7c5586c995fe" src="/sites/default/files/inline-images/Search-Highlighting-800.png" class="align-center" /> <p> </p> <ul> <li>Search was implemented with a single field which searches in all text fields <ul> <li>This was easier to implement</li> <li>A filter below every column, as in model driven apps could be another option for the future.</li> </ul> </li> <li>Highlighting the matched text was very easy to implement, so this functionality was added as well, even though it does not exist in model-driven apps</li> </ul> <p> </p> <h4>Column selection and reordering<br />  </h4> <img alt="Select columns" data-entity-type="file" data-entity-uuid="60057dc1-b686-4bab-9768-013a98b68d35" src="/sites/default/files/inline-images/Select-columns%20-%20800.png" class="align-center" /> <p> </p> <ul> <li>A modal dialog window can be used to select the columns to display</li> <li>A drag and drop component can be used to reorder the columns. The <a href="https://dndkit.com/overview">@dnd-kit/sortable library </a>was used to implement this feature</li> <li>The adjusted view is updated in the Dataverse personal view</li> </ul> <p> </p> <h4>Card View</h4> <img alt="Card View" data-entity-type="file" data-entity-uuid="83ad4ccb-1adc-4366-a153-900f2c7a75d6" src="/sites/default/files/inline-images/Accounts-Cardview-800.png" class="align-center" /> <p> </p> <ul> <li>A Card View as an alternative to a List View was implemented</li> <li>This was quite easy because a card already exists as a UI component in the React UI Components</li> <li>This view is especially useful for data with images</li> </ul> <p> </p> <h4>Detail View Edit Dialog</h4> <img alt="Detail View Edit Dialog" data-entity-type="file" data-entity-uuid="9715deab-a704-462f-a6d6-e44f5fed7d02" src="/sites/default/files/inline-images/Editor-800_0.png" class="align-center" /> <p> </p> <ul> <li>A detailed review was implemented to show and edit the current record</li> <li>The code dynamically parses the system form record to create the layout dynamically from the defaults form definition (including tabs)</li> <li>Field types text, text area, option set, lookup, yes/no, date/time are supported and fully working</li> <li>Of course, the form doesn't support PCF or sub grids.</li> <li>An alternative approach approach for the future, could be to redirect to a detail view, like a Model-Driven-App does </li> </ul> <p> </p> <h4>Table Column Definitions</h4> <img alt="Column meta data list" data-entity-type="file" data-entity-uuid="b3926707-c64d-40ce-a2ba-1a91b65b3814" src="/sites/default/files/inline-images/Schema-Browser-800.png" class="align-center" /> <p> </p> <ul> <li>A column meta data list was implemented</li> <li>It automatically shows all columns of the table with display name, data type, required, and description</li> <li>It proves that metadata can easily be fetched by the @microsoft/power-apps/data lib (for code apps)</li> <li>The column metadata can also be filtered</li> <li>The screenshot shows the list in dark mode. Of course, dark mode is available for the whole application. </li> </ul> <h4> Settings dialog </h4> <img alt="Settings dialog" data-entity-type="file" data-entity-uuid="aa4c2d07-fcce-4ca5-a210-87e179d8f429" src="/sites/default/files/inline-images/settings-400.png" class="align-center" /> <p> </p> <ul> <li>A small settings dialog was implemented for the settings of dark mode, display density, and accent color</li> <li>This was very easy to implement since dark mode, accent color and density are just properties in the React Fluent UI library</li> <li>The settings are stored in the local storage of the browser for simplicity</li> </ul> <h2>Lessons learned with GitHub Copilot and Claude Code</h2> <p>The project was developed almost entirely in "interactive agent-driven mode".<br /> Both GitHub Copilot and Claude Code were used as active development assistants during the entire process.<br /> <br /> The agents were involved in:</p> <ul> <li>Concept discussions</li> <li>Implementation</li> <li>Refactoring</li> <li>Architectural decisions</li> <li>Documentation improvements</li> <li>Iterative improvements to the collaboration workflow</li> </ul> <p>In addition to generating code, the agents were also used to discuss best practices and improve the documentation and structure of the project itself. Both agents used the same model (Claude Sonnet 4.6), but produced different results due to their overall architectural differences.</p> <p><br /> <strong>Claude Code</strong></p> <p>Overall, Claude Code produced more consistent and reliable results.<br /> <br /> Strengths included:</p> <ul> <li>Better architectural reasoning</li> <li>More structured implementations</li> <li>Clearer explanations</li> <li>Higher-quality refactorings</li> </ul> <p>Claude Code was particularly strong when working across multiple files or when performing larger structural changes in the project. In the beginning it introduced reusable UI components even before having instructions to do so.<br /> When working with Claude Code, development sessions occasionally reached usage limits. This required temporarily switching back to GitHub Copilot until the session limit reset. As a result, the project naturally evolved into a mixed workflow where both tools contributed to the final implementation.</p> <p><strong>GitHub Copilot</strong></p> <p>GitHub Copilot performed well for smaller tasks but showed some weaknesses when acting as a full development agent.<br /> <br /> Some common issues included:<br /> - Guessing instead of reasoning<br /> - Repeating the same incorrect approach multiple times<br /> - Getting stuck in loops when a problem was not clearly defined<br /> <br /> However, some of these issues were likely influenced by better instructions given to the agent (e.g. links to the official documentation, instructions to always look there first) <br /> <br /> At the beginning of the project, important rules were not yet defined, for example:<br /> - Asking for confirmation before large refactorings<br /> - Explaining architectural changes before applying them<br /> - Avoiding speculative changes<br /> <br /> Once clearer rules were established, the results improved.</p> <h2>Architecture</h2> <p>The architecture naturally follows the architecture of Power Apps Code Apps. Services for accessing data and model classes were generated using the pac tool.</p> <p>The following architecture diagram was generated with Claude Code. This no longer has to be done manually by hand either...</p> <img alt="Architecture" data-entity-type="file" data-entity-uuid="8f7e12a6-d6cd-42d9-b7c4-01ede36e8977" src="/sites/default/files/inline-images/architecture.png" class="align-center" /> <h2>Conclusion</h2> <p>It is extremely impressive how quickly and easily a Power Apps Code App can be developed with GitHub Copilot or Claude Code. What makes development so fast and straightforward is the combination of coding agents with an intelligent framework for app development.</p> <p>Throughout the entire development process, there was never any sense of working with an unstable product or with something that had only recently reached general availability. There were no crashes at all, and deploying the app via solution to another environment also worked flawlessly.</p> <p>Only in a few places does the API appear to be not entirely complete yet. For example, <code>RetrieveRecordAsync</code> did not work, so a workaround had to be implemented using <code>GetAll</code> with a filter expression. However, the most important actions for loading, filtering, and saving data are already very stable.<br /> <br /> Code Apps will fundamentally change the way we build apps in Dataverse environments and across the Power Platform. Canvas Apps may soon become obsolete and be replaced by Code Apps. There may also be more options in the future to integrate Code Apps into Model-Driven Apps. Until then, however, both can coexist peacefully side by side.</p> <p><br />  </p></div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2026-03/Power-Apps-Code-Apps-in-Practice_1.png</div> </div> </div> </div> </div> Wed, 11 Mar 2026 14:56:40 +0000 Axel 870 at https://dynamics-chronicles.com Row Summary in Model-Driven Apps https://dynamics-chronicles.com/article/row-summary-model-driven-apps <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Row Summary in Model-Driven Apps</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/stephane-pelhatre" lang="" about="/user/stephane-pelhatre" typeof="schema:Person" property="schema:name" datatype="" class="username">Stephane Pelhatre</a></span> <span property="schema:dateCreated" content="2025-10-14T08:04:03+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 10/14/2025 - 10:04</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h3>Introduction</h3> <p>In model-driven applications, forms often contain many fields spread across multiple tabs and sections, which can make it difficult and time-consuming to find key information. Navigating between these tabs slows productivity and increases the risk of missing important information. Finding key insights quickly can be a challenge.</p> <p>The Row Summary feature solves this problem by displaying a clear and concise summary of the most important information. Makers can customize the columns to include and choose how the summary is presented (as bullet points or as a short paragraph). This allows users to get the necessary context at a glance, without having to scroll through the entire form.<br /> Furthermore, the summary can include clickable links to related records.</p> <p>At the time of writing this article, this feature is still in preview.<br /> Summaries are currently only supported in the English language.<br /> Preview features aren’t meant for production use and might have restricted functionality.</p> <h3>Enable Row Summary feature</h3> <p>Before you can configure a Row Summary, you need to enable the feature in your environment:</p> <ol> <li>Go to <a href="https://admin.powerplatform.microsoft.com">Power Platform Admin Center</a></li> <li>Select your environment</li> <li>Go to <strong>Settings &gt; Product &gt; Features</strong><br /> <img alt="enable0" data-entity-type="file" data-entity-uuid="02031ea5-0e19-4bd1-a664-fd4c5a7e848e" src="/sites/default/files/inline-images/enable%20feature1.png" /><br />  </li> <li>Enable the feature <strong>AI Insight Cards</strong><br /> <img alt="Enable1" data-entity-type="file" data-entity-uuid="cd7be403-59f5-40d9-8689-8efcdb06684f" src="/sites/default/files/inline-images/Enable1_0.png" /></li> </ol> <p>Once enabled, you’ll be able to access and configure the Row Summary feature in model-driven apps.</p> <h3>Configure Row Summary for a table</h3> <p>To configure a row summary for main forms for a specific table:</p> <ol> <li>Open <a href="https://make.powerapps.com/">Power Apps Portal</a> and select your environment</li> <li>Select the table where you want to apply the row summary (e.g., Contact) from the left navigation pane and click on <strong>Row summary</strong> in the section <strong>Customizations<br /> <img alt="Enable2" data-entity-type="file" data-entity-uuid="b9449246-8aee-46cd-a2d8-8558df313b72" src="/sites/default/files/inline-images/Enable2.png" /></strong><br /> <br /> Another way is to select your table from the left navigation pane and click on <strong>Forms </strong>in the section <strong>Data experience<br /> <img alt="Enable8" data-entity-type="file" data-entity-uuid="6f75bf72-246c-4780-bc0b-f2ad9375243e" src="/sites/default/files/inline-images/Enable8.png" /></strong><br /> <br /> Then click on <strong>Row summary</strong> on the command bar and from the dropdown select <strong>Edit Summary </strong>to begin customization<br /> <img alt="Enable3" data-entity-type="file" data-entity-uuid="c793e558-8c1f-4a6b-833e-f9e49427ff71" src="/sites/default/files/inline-images/Enable3.png" /><br />  </li> <li>Following window is displayed:<br /> <img alt="Enable4" data-entity-type="file" data-entity-uuid="58879e41-495b-46dc-a92e-e65860d37813" src="/sites/default/files/inline-images/Enable4.png" /><br />  </li> <li>Now you have to define columns to include in the summary and write a prompt<br /> - In the Prompt editor, click on <b>+Add data </b>or type "/" to choose the columns you want the AI to summarize (in my example: full name, job title, company name, marital status)<br />   If you click on <b>+Add data </b>you can add several columns in one step which is not the case if you type "/"<br /> - Write a custom instruction (prompt) describing how the summary should be generated<br />   In my example below : <em>Generate a concise summary using the selected fields. Use bullet points and return “No value” if a field is empty<br /> <img alt="Enable5" data-entity-type="file" data-entity-uuid="95317f6a-7933-44f3-a180-db57a3eb4c88" src="/sites/default/files/inline-images/Enable5.png" /></em><br />  </li> <li>Click on <strong>Test </strong>to preview the summary output (the most recently edited record is used to generate the test response)<br /> <img alt="Enable6" data-entity-type="file" data-entity-uuid="57e8d46b-b361-4f40-b55e-b680a06ca89b" src="/sites/default/files/inline-images/Enable6.png" /><br />  </li> <li>Once satisfied, click on <strong>Apply to main forms</strong> to enable the summary across all main forms for your table<br />  </li> </ol> <p>Display the list of forms : an AI icon is visible for forms where the summary is active (only main forms)<br /> <img alt="Enable7" data-entity-type="file" data-entity-uuid="133c10d2-1fe7-4f3c-9d1a-84a2acbc2c20" src="/sites/default/files/inline-images/Enable7.png" /></p> <p>To modify an existing row summary:</p> <ol> <li>In <a href="https://make.powerapps.com/">Power Apps Portal</a> select your table where you want to modify the row summary</li> <li>Click on <strong>Forms </strong>in the section <strong>Data experience</strong><br /> Then click on <strong>Row summary</strong> on the command bar and from the dropdown select <strong>Edit Summary <br /> <img alt="Modify1" data-entity-type="file" data-entity-uuid="1aaa7ca0-540a-4689-a304-c93c8a7eed58" src="/sites/default/files/inline-images/Modify1.png" /></strong><br /> <br /> An alternative to the previous method (point 2) is to click on <strong>Row summary (applied) </strong>in section <strong>Customizations<br /> <img alt="Modify2" data-entity-type="file" data-entity-uuid="5c91604b-7fb9-4bbf-8863-bee3a28ea558" src="/sites/default/files/inline-images/Modify2.png" /></strong><br />  </li> <li>Make your changes to the prompt or included columns and reapply</li> </ol> <p>To remove a summary from all forms:</p> <ol> <li>In <a href="https://make.powerapps.com/">Power Apps Portal</a> select your table where you want to remove the row summary</li> <li>Click on <strong>Forms </strong>in the section <strong>Data experience</strong>.<br /> Then click on <strong>Row summary</strong> on the command bar and from the dropdown select <strong>Hide on all main forms<br /> <img alt="Hide1" data-entity-type="file" data-entity-uuid="c077490f-7872-44dd-9507-082ea7e198de" src="/sites/default/files/inline-images/Hide1.png" /></strong></li> </ol> <h3><br /> View Row Summary in Dynamics 365</h3> <p>Open your app in Dynamics 365 and navigate to the entity (e.g., Contact) where the row summary is configured.<br /> Select a record in the view : an AI summary icon is displayed.<img alt="Use1" data-entity-type="file" data-entity-uuid="1ccfd515-4736-456a-a423-127321a7c6bb" src="/sites/default/files/inline-images/Use1_1.png" /><br /> <br /> Click on this icon : AI-generated summary is displayed in a modal popup.<img alt="Use2" data-entity-type="file" data-entity-uuid="f97e3e25-2fda-42f9-99a3-88f8916b2e2d" src="/sites/default/files/inline-images/Use2_0.png" /></p> <p>Note that you can copy the summary into the clipboard.</p> <p>If you open a record (e.g., Contact) the summary is displayed at the top of the form in a collapsible bar (called Insights bar).<br /> <img alt="Use3" data-entity-type="file" data-entity-uuid="0b67c080-7a67-4464-afb1-c6086f909571" src="/sites/default/files/inline-images/Use3_0.png" /></p> </div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2025-10/ChatGPT%20Image%20Oct%2020%2C%202025%2C%2006_24_24%20PM.png</div> </div> </div> </div> </div> Tue, 14 Oct 2025 08:04:03 +0000 Stephane Pelhatre 861 at https://dynamics-chronicles.com Dataverse: Duplicate Detection Rules vs Alternate Keys https://dynamics-chronicles.com/article/dataverse-duplicate-detection-rules-vs-alternate-keys <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Dataverse: Duplicate Detection Rules vs Alternate Keys</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/stephane-pelhatre" lang="" about="/user/stephane-pelhatre" typeof="schema:Person" property="schema:name" datatype="" class="username">Stephane Pelhatre</a></span> <span property="schema:dateCreated" content="2025-10-08T15:57:17+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 10/08/2025 - 17:57</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h3>Introduction</h3> <p>Having clean data in Dataverse can be tricky. One of the challenges is detecting and managing duplicate records.<br /> With out-of-the-box tools you can implement duplicate detection rules or create alternate keys.<br /> If you are a developer, you can implement a custom validation in a plugin.<br /> In this article we will focus on out-of-the-box features (duplicate detection rules and alternate keys) and compare them.</p> <h3>Duplicate detection rules</h3> <p>First step is to check if the feature <em>Duplicate Detection</em> is enabled in your environment (it is enabled by default):</p> <ol> <li>Connect to Dynamics 365 and open <strong>Power Platform Environment Settings </strong>app</li> <li>Click on <strong>Data Management</strong> on the left pane and select <strong>Duplicate detection settings<br /> <img alt="Enable1" data-entity-type="file" data-entity-uuid="82de77bd-935c-4901-8e51-323c559ac4e7" src="/sites/default/files/inline-images/enable%201_2.png" /></strong><br />  </li> <li>Check that the option <strong>Enable duplicate detection</strong> is enabled<br /> <img alt="Enable2" data-entity-type="file" data-entity-uuid="29cd6636-f3cb-4b3a-8a4b-113f4c280994" src="/sites/default/files/inline-images/enable%202_1.png" /><br /> <br /> There are 3 triggers that you can activate:</li> </ol> <ul> <li>When a record is created or updated</li> <li>When Microsoft Dynamics 365 for Outlook goes from offline to online</li> <li>During data import</li> </ul> <p>Second step is to make sure the feature is enabled for your table:</p> <ol> <li>Open <a href="https://make.powerapps.com/">Power Apps Portal</a> and select your environment</li> <li>Select your table on the left pane and click on <strong>Properties<br /> <img alt="Enable3" data-entity-type="file" data-entity-uuid="b063d228-a864-4888-984c-3c98f81a79f1" src="/sites/default/files/inline-images/enable%203.png" /></strong><br />  </li> <li>Expand <strong>Advanced options</strong> pane and ensure that <strong>Apply duplicate detection rules</strong> is checked<br /> <img alt="Enable4" data-entity-type="file" data-entity-uuid="3a0e8ef4-f0d5-488f-b539-5a63673485d7" src="/sites/default/files/inline-images/enable%204_0.png" /></li> </ol> <p>Then you can create duplicate detection rules:</p> <ol> <li>Connect to Dynamics 365 and open<strong> Power Platform Environment Settings </strong>app</li> <li>Click on <strong>Data Management</strong> on the left pane and select <strong>Duplicate detection rules<br /> <img alt="rule1" data-entity-type="file" data-entity-uuid="39c290ff-cd34-416d-8e94-472057d321ed" src="/sites/default/files/inline-images/rule1_0.png" /></strong><br />  </li> <li>All out-of-the-box duplicate detection rules are displayed<br /> <img alt="rule2" data-entity-type="file" data-entity-uuid="ebc76ed5-f1b1-4038-9fdf-ef7aef026f24" src="/sites/default/files/inline-images/rule2_1.png" /><br />  </li> <li>Click on <strong>New </strong>on the command bar<br /> Below an example with the out-of-the-box rule <em>Contacts with the same first name and last name </em>for Contact table<br /> <img alt="rule3" data-entity-type="file" data-entity-uuid="99d8e059-d2be-45da-b97b-3e4c57da25f4" src="/sites/default/files/inline-images/rule3_0.png" /><br /> <br /> Provide a name and description for the rule and define the criteria for identifying duplicates:</li> </ol> <ul> <li><strong>Base Record Type</strong>: select the type of record the rule applies to (e.g., Contacts).</li> <li><strong>Matching Record Type</strong>: select the type of record to compare. Typically, this is the same as the base record type, but you can compare different types (e.g., Contacts and Leads).</li> <li><strong>Exclude Inactive Records</strong>: check this box if you want to exclude inactive records from the duplicate detection process.</li> <li><strong>Case-Sensitive</strong>: check this box if the rule should be case-sensitive.</li> <li><strong>Field Selection</strong>: for each criterion, select the fields to compare and the operator (e.g., Exact Match).</li> <li>I<strong>gnore Blank Values</strong>: check this box if you do not want the rule to consider blank fields as equal.<br type="_moz" /> <br /> You can add several criterions to your rule criteria:<br /> For text fields you have 3 choices:<br /> - <em>Exact Match</em><br /> - <em>Same First Characters</em><br /> - <em>Same Last Characters</em><br /> For Datetime fields you have 2 choices:<br /> - <em>Same date</em><br /> - <em>Same date and time</em><br /> For whole number/decimal and lookup fields only <em>Exact Match</em> is available</li> </ul> <p>      5. After configuring the criteria, click on <strong>Save</strong>.<br />           To make the rule active, select it and click on <strong>Publish</strong>.<br />           Note that you can only publish up to five rules for the same base record type at a time.</p> <p>Now let's try creating a duplicate record using Dynamics 365 UI. For example a contact with existing first name and last name.<br /> You should see a pop-up dialog with the warning message <em>Duplicate records found</em>.<br /> <img alt="rule4" data-entity-type="file" data-entity-uuid="2b2bc889-8f1c-4e1a-b9eb-c9475edd7e12" src="/sites/default/files/inline-images/rule4_0.png" /></p> <p>You have 3 possibilities:</p> <ul> <li><strong>Ignore and save</strong> : if you are certain the record is unique or requires a new entry despite the match, click "Ignore and Save" to create the duplicate</li> <li><strong>Merge </strong>: if you want to combine the information from both records into a single, primary record, select "Merge." You will typically be prompted to choose which record will be the primary one, and then you can select which fields to keep from each record</li> <li><strong>Cancel </strong>: do not create the duplicate record</li> </ul> <h3>Alternate keys</h3> <p>An alternative to duplicate detection rule is to create alternate keys.<br /> This method is the same as creating unique-index(es) from the database perspective. Hence this method will be more strict compared to duplicate detection rules.<br /> An alternate key can combine one or several columns.<br /> It can contain multiple rows with NULL values. NULL values are not indexed.</p> <p>Some limitations:</p> <ul> <li>There can be a maximum of 10 alternate keys for a table in a Dataverse instance</li> <li>Columns used in the key must not have field-level security applied</li> <li>Alternate keys aren't supported in virtual tables</li> <li>When a key is created, the system validates the key, including that the total key size doesn't violate SQL-based index constraints like 900 bytes per key and 16 columns per key. If the key size doesn't meet the constraints, an error message is displayed</li> <li>Unicode characters in key value. If the data within a column that is used in an alternate key contains one of the following characters /,&lt;,&gt;,*,%,&amp;,:,\\,?,+ then retrieve (GET), update or upsert (PATCH) actions won't work. If you only need uniqueness, then this approach works, but if you need to use these keys as part of data integration then it's best to create the key on columns that won't have data with those characters</li> </ul> <p>To create an alternate key for a specific table:</p> <ol> <li>Open <a href="https://make.powerapps.com/">Power Apps Portal</a> and select your environment</li> <li>Select the table into which you want to create an alternate key</li> <li>Click on <strong>Keys</strong></li> <li>Provide a display name and select the columns to include in your key<br /> In the example below I create an alternate key in table <em>Contact </em>for columns birthday and last name<img alt="key2" data-entity-type="file" data-entity-uuid="420b5f90-3b7b-492f-b551-2310c5edbee1" src="/sites/default/files/inline-images/key2_4.png" /> <p>Only columns of the following types can be included in alternate key table definitions:<br />     - Decimal Number<br />     - Whole Number<br />     - Single line of text<br />     - Date Time<br />     - Lookup<br />     - Option Set</p> </li> <li> <p>Click on <strong>Save</strong>. The system will automatically create the index in the database.<br /> If the system detects duplicate data in the table, the creation will fail and you need to delete data first.<br /> If there are lots of existing records in your table, index creation can be a lengthy process.<br /> During creation of the key status will be <em>Pending</em>. Once the creation is complete status changes to <em>Active</em>.<br /> <img alt="key3" data-entity-type="file" data-entity-uuid="0febdf8e-6580-49ef-ad78-428a12defaf2" src="/sites/default/files/inline-images/key3_2.png" /></p> </li> </ol> <p>Now let's try creating a duplicate record using Dynamics 365 UI. To be consistent with the alternate key created previously, a contact with existing birthday and last name.<br /> You should see a pop-up error with the message <em>Duplicate record</em>.</p> <p><img alt="Key 4" data-entity-type="file" data-entity-uuid="efbb6b10-e151-47cf-801c-7fb645d4e9f4" src="/sites/default/files/inline-images/key4_0.png" /></p> <p>Therefore, it is impossible to create a duplicate record with the user interface. This makes sense as uniqueness is ensured at the database level.</p> <h3>Creating/Updating records programmatically</h3> <p>We have seen that behavior is different when we create a duplicate record with the UI using duplicate detection rules or alternate keys.<br /> But what happens if we create duplicate records programmatically with Dynamics 365 SDK or Web API?</p> <h4>Duplicate detection rules</h4> <p>By default duplicate detection rules are not applied when you are creating or updating records using Web API or Dynamics 365 API. Therefore duplicate records will be created.<br /> If you want Dynamics 365 to raise an error you must utilize an optional parameter.<br /> With Web API use parameter <code>MSCRM.SuppressDuplicateDetection</code> in the header of your HTTP request (<em>POST </em>to create a record or <em>PATCH </em>to update a record)  to avoid creation of a duplicate record of an existing record.<br /> The value assigned to <code>MSCRM.SuppressDuplicateDetection</code> determines whether the Create or Update operation can be completed:</p> <ul> <li><em>true</em>: Create or update the record, if a duplicate is found.</li> <li><em>false</em>:  Do not create or update the record, if a duplicate is found.</li> </ul> <p>So ensure that <code>MSCRM.SuppressDuplicateDetection</code> is set to <em>false </em>in your Web API request to detect duplicates.<br /> You will get the following error message if you try to create a duplicate record:</p> <p><em>{<br />   "error": {<br />     "code": "0x80040333",<br />     "message": "A record was not created or updated because a duplicate of the current record already exists."<br />   }<br /> }</em></p> <p>Note that if you do not use <code>MSCRM.SuppressDuplicateDetection </code>duplicates will be created.<br /> Below an example of POST request to create a contact named "John Doe" with activation of duplicate detection rules.</p> <pre> <code class="language-http">POST [Organization URI]/org1/api/data/v9.2/contacts If-None-Match: null OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json Accept: application/json MSCRM.SuppressDuplicateDetection: false { "firstname":"John", "lastname":"Doe" }</code></pre> <p>And below an example performed with XrmToolbox plugin <em>WebAPI Launcher.</em><br /> Note parameter <code>MSCRM.SuppressDuplicateDetection </code>in the header.</p> <p><img alt="Prog 1" data-entity-type="file" data-entity-uuid="a80f712c-01c1-45fe-9ce2-42ea21edc56f" src="/sites/default/files/inline-images/Prog1.png" /></p> <p>And the result of this Web API request if we try to create a duplicate:<br /> <img alt="Prog 2" data-entity-type="file" data-entity-uuid="49f87afd-9a4c-408b-9717-5cea346adfb2" src="/sites/default/files/inline-images/Prog2.png" /></p> <p>With Dynamics 365 SDK you have to use <code>SuppressDuplicateDetection</code> optional parameter in your request (<em>CreateRequest </em>or <em>UpdateRequest</em>) if you want the configured duplicate detection rules to run and throw an exception while creating or updating a record.<br /> So set its value to <em>false </em>in your code to trigger duplicate detection rules.<br /> You will get the following error if you try to create a duplicate record:<br /> <em>A record was not created or updated because a duplicate of the current record already exists</em></p> <p>Below a C# example to create with the SDK a contact named "John Doe" with activation of duplicate detection rules.</p> <pre> <code class="language-cs">namespace CrmDuplicateDetection { class Program { static void Main(string[] args) { CrmServiceClient.MaxConnectionTimeout = TimeSpan.FromHours(3); var connectionString = WebConfigurationManager.AppSettings["connectionString"]; var client = new CrmServiceClient(connectionString); var contact = new Entity("contact") { ["firstname"] = "John", ["lastname"] = "Doe" }; var createRequest = new CreateRequest { Target = contact }; // Pass parameter 'SuppressDuplicateDetection' to trigger Duplicate Detection Rules createRequest["SuppressDuplicateDetection"] = false; var response = (CreateResponse)client.Execute(createRequest); } } }</code></pre> <h4>Alternate keys</h4> <p>If you try to create a duplicate record programmatically with Dynamics 365 SDK you will get an error even if you set parameter <code>SuppressDuplicateDetection</code> to <em>false </em>in your <em>CreateRequest</em>/<em>UpdateRequest </em>request (and same if you set <code>MSCRM.SuppressDuplicateDetection </code>to <em>false </em>in the header of your Web API request).</p> <p>Below an example of Web API POST request to create a contact with last name and birthdate that already exist in Dataverse.</p> <p><img alt="Prog3" data-entity-type="file" data-entity-uuid="4e4b2b72-300c-4482-aeec-429c11f598ca" src="/sites/default/files/inline-images/Prog3.png" /></p> <h3>Conclusion</h3> <p>As we have seen alternate keys are a strict way to avoid duplicates creation and ensure data correctness.<br /> It is not possible to create duplicate records using Dynamics 365 user interface or Web API/Dynamics 365 SDK.<br /> But alternate keys have some limitations (10 alternate keys max per table, not supported in virtual tables, cannot include columns with field level security enabled, no operator Same First/Last characters in the criteria).<br /> Duplicate detection rules are more flexible when creating duplicate records through the UI (ability to merge records or force the creation of duplicates).<br /> And with Web API/Dynamics 365 SDK you can choose whether you want to apply duplicate detection rules when creating/updating records.<br /> So the choice between duplicate detection rules and alternate keys will depend on whether you want to allow duplicates creation under certain circumstances.<br /> If you never want to create duplicate records (either through the user interface or programmatically) alternate keys are a good solution because the check is done at database level.<br /> But if you want to warn users when they try to create a duplicate record in the UI and allow them to confirm or not the duplicate creation (and use <em>Merge </em>feature) duplicate detection rules are a good choice.<br /> The same is true if you have interfaces between a third-party system and Dynamics 365 (an Azure webjob or Azure function for instance) and want to allow or not creation of duplicates.<br /> But if you have an existing interface that allows the creation of duplicate records and want to change this behavior, you will have to modify the source code of the interface to use <code>SuppressDuplicateDetection</code> parameter to trigger duplicate detection rules.</p> </div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2025-10/ChatGPT%20Image%20Oct%2020%2C%202025%2C%2006_26_53%20PM.png</div> </div> </div> </div> </div> Wed, 08 Oct 2025 15:57:17 +0000 Stephane Pelhatre 860 at https://dynamics-chronicles.com Custom Pages for converging Power Apps Model-Driven and Canvas https://dynamics-chronicles.com/article/custom-pages-converging-power-apps-model-driven-and-canvas <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Custom Pages for converging Power Apps Model-Driven and Canvas</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/danny-rodrigues-alves" lang="" about="/user/danny-rodrigues-alves" typeof="schema:Person" property="schema:name" datatype="" content="Danny Rodrigues Alves" class="username">Danny Rodrigue…</a></span> <span property="schema:dateCreated" content="2023-01-17T13:00:14+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 01/17/2023 - 14:00</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><p><em>Custom Pages for converging Power Apps Model-Driven and Canvas</em></p> <h3>Why do we need Custom Pages</h3> <p>With the public preview announced in mid-2021 and the GA (General Availability) in December 2022, <em><strong>Custom Pages</strong></em> are a long waited feature in the Power Platform universe. With <em>Custom Pages</em>, customizers have a new tool when building model-driven apps. Until then, canvas apps could be added in a form or as an iframe in a dashboard. Similar to a canvas app, <em>Custom Pages</em> can be used as a main page, as dialogs, or also as side panes. It opens new possibilities when integrating data from different sources into a single model-driven app.</p> <p>That's where the usefulness of <em>Custom Pages</em> resides. It gives a much more flexible way to present data in a View, Form, or Dashboard, regardless of the data coming from a Dataverse table, multiple tables, or any other source.</p> <h3>Custom Pages: Definition</h3> <p><em>Custom Pages</em> are a new type of page that can be integrate into a model-driven application. They are very similar to well-known <em>Canvas Apps</em>, but with pixel-perfect native integration in a model-driven app. They have been built by Microsoft to be used with the same canvas designer screen.</p> <p>That's the power of <em>Custom Pages</em>: they can use almost the same features as Canvas Apps. For example, more than 600 connectors are available to retrieve data and multiple data can be shown on the same screen. They can also incorporate <em>Power Apps Component Framework</em>, commonly known as PCFs. Meaning low-code and pro-code elements can be added to a <em>Custom Page</em>!</p> <p><em>Custom Pages</em> are "kind" of a canvas app, but with an increased knowledge of the context of the model-driven page app running the page. It's more <em>naturally</em> embedded in the model-driven app. They are part of the model-driven app infrastructure and can only be used inside such app.</p> <p>Concerning licensing, since <em>Custom Pages </em>are a feature of model-driven apps, they follow the same licenses.</p> <h3>Custom Pages VS Canvas App</h3> <p>As stated multiple times, <em>Custom Pages</em> are not the same concept as Canvas Apps, but they share numerous similarities. The main difference is that a Canvas App can exist as a stand-alone component, whereas Custom Pages are just a component of a model-driven app.</p> <p>It was already possible to incorporate a canvas app into a model-driven app, as explained in <a href="https://dynamics-chronicles.com/article/canvas-app-embedded-model-driven-app">this Veron's article</a>. The new thing with <em>Custom Pages</em>, resides in they being an integrated part of model-driven apps, not just an external component added to a form.</p> <p><em>Custom Pages</em> enable us to go much further in the integration between model-driven and canvas apps. For example, the current limitation on the number of embedded canvas apps hasn't changed. Technically and in terms of embedment, <em>Custom Pages</em> are much better integrated (responsiveness). Also, no need to share the custom page with everyone, the model-driven security is applied!</p> <p>Existing standalone canvas apps aren't supported for use as a custom page and the expected app structure is different. A standalone canvas apps often have many screens with global access to all controls and variables. The custom page is expected to typically be a single screen with loose coupling to provide performance and co-development capabilities.</p> <p>Find here below the steps to convert a <i>Canvas App</i> into a <em>Custom Page:</em></p> <ol> <li>Create a blank custom page from the model-driven app designer. More information: <a data-linktype="relative-path" href="https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/add-page-to-model-app">Add a custom page to your model-driven app</a></li> <li>Add a canvas app data source for data used by the screen.</li> <li>Copy the screen from the canvas app in the original canvas app designer. <ol> <li>Open a single screen of the canvas app, CTRL+A, CTRL+C</li> </ol> </li> <li>Paste the screen into the new custom page in the model-driven app designer. <ol> <li>Ho to the custom page, CTRL+V.</li> </ol> </li> <li>Change the navigate calls to use the custom page name instead of the screen name.</li> <li>Add the custom page to the model-driven app designer site map</li> </ol> <p><em>Custom Pages</em> will have a single screen. Instead of multiple screens, they will use the custom page's navigation functions to move to another custom page or model-driven app page.</p> <h3>Solution</h3> <p>In a solution, <em>Custom Page</em> can be found under the <em>Pages</em> section.</p> <p><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="18591d03-5439-4447-9a7d-7cb449c7f779" src="/sites/default/files/inline-images/SolutionPage_0.png" /></p> <p> </p> <h3>Step-by-step: Create a Custom Page</h3> <p><em>Custom Pages</em> can be created from the Modern App Designer.</p> <ol> <li>Edit a model-driven app in the maker portal</li> <li>In the ribbon, select the <em>Add page</em> button and then select the <em>Custom page</em> in the page type choices. <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="4075c17c-57e2-4b3a-a9fd-b163fe775dd5" src="/sites/default/files/inline-images/AddCustomPage_0.png" /></li> </ul> </li> <li>It's the possible to create a new page or to selecting an existing one. <ul> <li>By default, the new page will be added to the navigation pane.</li> </ul> </li> <li>A new tab will open in your browser with the <em>Canvas Editor</em>.</li> <li>The canvas editor is described in <a href="https://dynamics-chronicles.com/article/power-apps-presentation-tutorial-and-feedbacks-canvas-apps">this article</a> by Amaury Veron. For sake of simplicity, we can add a very simple label and a big rectangle in the middle. <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="73fbb793-bf11-4584-a225-e222f192ba8d" src="/sites/default/files/inline-images/EditorPage.png" /></li> </ul> </li> <li>Select the <em>Settings </em>icon <img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="657d508b-0d98-4eb9-afe2-6ed2dce72fc2" src="/sites/default/files/inline-images/SettingsButton.png" /> and add a name to the page <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="d41e9d22-02ec-41c6-a431-74592c92dc66" src="/sites/default/files/inline-images/Settings.png" /></li> </ul> </li> <li>Select the <em>Save</em> icon <img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="4afefbb8-e92f-4f48-85a4-24f78158639c" src="/sites/default/files/inline-images/SaveIcon.png" /></li> <li>Select the <em>Publish </em>icon <img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="d67c35bc-cdc8-4e11-b327-7b45f16820e9" src="/sites/default/files/inline-images/Publish.png" /></li> <li>Once saved and published, publish also the model-driven app.</li> <li>Then, the new custom page will appear in the model-driven app menu! <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="9b7df369-d8a0-4798-9ceb-30af63e5514a" src="/sites/default/files/inline-images/HelloWorldPage.png" /></li> </ul> </li> </ol> <p>And that's our first Custom Page!</p> <p> </p> <h3>Others examples</h3> <p>We can also extend the above Custom page and add to it an iFrame - with <a href="https://github.com/VinnyDyn/Iframe4Canvas">Iframe4Canvas</a> PCF - and a list of records from the <em>Leads</em> table.</p> <p><img alt="ModelDrivenWithCustomPage" data-entity-type="file" data-entity-uuid="e3093b2d-d61c-4b7a-9f8b-ce03b4d419b8" src="/sites/default/files/inline-images/ModelDrivenWithCustomPage.png" /></p> <p>The above example is quite a <em>Hello World. </em>But below you can find a more <em>real-life</em> solution that <em>Custom Pages</em> can bring into model-driven apps:</p> <ul> <li>The list of accounts is displayed on the left part of the page.</li> <li>When an account is selected, the stock history is displayed from the <em>WSJ</em> website<em>.</em></li> </ul> <p><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="ed177669-e121-45d3-9edc-e7b49d4102bb" src="/sites/default/files/inline-images/CustomPageFullStock.png" /></p> <p>In this example, a custom page is added to the model-driven menu, under the <em>My Work</em> section. The page contains a list of accounts from the Dataverse table. On the right, the stock price of the selected account is displayed.</p> <p>Some points about the above page:</p> <ul> <li>The stock price is displayed with the <a href="https://github.com/VinnyDyn/Iframe4Canvas"><em>Iframe4Canvas</em></a> component.</li> <li>To use custom PCF controls, you need first to enable the <em>Power Apps component framework for canvas apps</em> parameter via the <a href="https://admin.powerplatform.microsoft.com/">admin portal</a>. <ul> <li><img alt="Enable PCF" data-entity-type="file" data-entity-uuid="3abcc609-221d-4b11-b536-d6f65cd89089" src="/sites/default/files/inline-images/enable-pcf-feature.png" /></li> </ul> </li> <li>Note that once you saved and published the custom page, you still need to publish the model-driven app! <ul> <li>That will be the case every time you want to update your custom page!</li> <li>When a new version of the custom page is published and the model-driven app is also published, a warning will appear in the app. <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="acf084e0-b0df-41ca-b368-042c6d9db8f8" src="/sites/default/files/inline-images/NewVersion_0.png" /></li> </ul> </li> </ul> </li> </ul> <p> </p> <h3>Screen integrations</h3> <p>In the above example, the custom page was used as a page in a model-driven app. But there is much more usage for <em>Custom Pages</em>! With a little bit of code, they can be used a <a href="https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples#open-as-a-centered-dialog">center dialogs</a> or <a href="https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples#open-as-a-side-dialog">side dialogs</a> or even <a href="https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/create-app-side-panes">side panes</a>!</p> <p><em>Custom Pages</em> can be integrated in a model-driven app as a new page - like above - but there as also other way to use them. For all of the points below, some <em>JavaScript code </em>is needed, therefore a trigger is needed. The trigger can be for example a click on a button (button in the ribbon or in a view), it can also be a timer set in JavaScript within the <em>onload</em> event of the form, or even a <em>onChange</em> event based upon a field's value.</p> <p>To be able to display a <em>Custom Page</em> by code, only the unique name of the page. It can be founded in the <em>Default Solution</em>, under the <em>Pages</em> sections.</p> <p><img alt="DefaultPagesInSolution" data-entity-type="file" data-entity-uuid="ffbbc190-0bbc-4229-af38-81eeabe45665" src="/sites/default/files/inline-images/DefaultPagesInSolution.png" /></p> <p>To recap everything, there are four possible screen integrations:</p> <ul> <li><strong>As a new page</strong> <ul> <li>As displayed above, the <em>Custom Page</em> acts like a dashboard for example, taking the full width and height of the model-driven app.</li> </ul> </li> <li><strong>As a centered dialog</strong> <ul> <li>The <em>Custom Page</em> displays itself in the middle of the model-driven app, with width and height configurable by <em>JavaScript</em> code.</li> <li>JavaScript code: <ul> <li><img alt="CenterDialogJS" data-entity-type="file" data-entity-uuid="0c3d9385-0dc7-4b91-ade9-1172d07ddd44" src="/sites/default/files/inline-images/CenterDialogJS.png" /></li> </ul> </li> <li>Example: <ul> <li><img alt="CenteredPage" data-entity-type="file" data-entity-uuid="42b019e2-e715-4fb0-9504-c1e2917e020e" src="/sites/default/files/inline-images/CenteredPage.png" /></li> </ul> </li> </ul> </li> <li><strong>As a right-side panel</strong> <ul> <li>The <em>Custom Page</em> displays itself in the right part of the model-driven app, overlapping the screen.</li> <li>JavaScript code: <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="51d42429-d8c6-4b2e-8420-4cafc1d5c063" src="/sites/default/files/inline-images/SideDialogLS.png" /></li> </ul> </li> <li>Example: <ul> <li><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="5798f884-7860-4f4f-8be4-5c887019123b" src="/sites/default/files/inline-images/RightPanelPage.png" /></li> </ul> </li> </ul> </li> <li><strong>As a right-side pane</strong> <ul> <li>The <em>Custom Page</em> displays itself in the pane part of the model-driven app. The page doesn't overlap current page, but two pages are displayed side-by-side.</li> <li>JavaScript code: <ul> <li><img alt="SidePaneCodeJS" data-entity-type="file" data-entity-uuid="3d11fc79-49f3-4455-b8cc-7a027859a00c" height="228" src="/sites/default/files/inline-images/SidePaneCodeJS.png" width="452" /></li> </ul> </li> <li>Example: <ul> <li><img alt="SidePaneScreen" data-entity-type="file" data-entity-uuid="e3f4307b-32fe-4096-9fd7-3862493571db" height="622" src="/sites/default/files/inline-images/SidePaneScreen.png" width="1235" /></li> </ul> </li> </ul> </li> </ul> <p> </p> <p>All JavaScript code above comes from the <a href="https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples">Microsoft documentation</a>.</p> <p> </p> <h3>Custom page with parameters</h3> <p>Via the JavaScript code, it is also possible to send parameters to the <em>Custom Page</em>. With this feature, it completely possible to create record-aware!</p> <p>Here is an example of <em>JavaScript</em> code to send a parameter from the model-driven app code to the <em>Custom Page</em>.</p> <p><img alt="Custom Pages for converging Power Apps Model-Driven and Canvas" data-entity-type="file" data-entity-uuid="6e693c90-c959-4cb3-b044-b0df2657749d" src="/sites/default/files/inline-images/PassParameters.png" /></p> <p>In the <em>Custom Page</em>, the parameters can be retrieved as follows:</p> <p><img alt="ReceiveParameters" data-entity-type="file" data-entity-uuid="2597f6fc-fd0a-46ec-a525-b49b28460311" src="/sites/default/files/inline-images/ReceiveParameters.png" /></p> <p> </p> <h3>Conclusion</h3> <p><em>Custom Page</em> is a new and very important and usefull tool when building model-driven apps. It offers an out-of-the-box integration for "model-driven canvas apps". All cool features of canvas apps, like PCF and PowerFx support, connectors, and easy-to-use editor are present. They can be added into solutions, don't need sharing, and can therefore be integrated into any CI/CD pipeline.</p> <p>The only major drawback is that they can't be added directly into a form. Javascript code is still needed for the moment. Hopefully, a PCF or another feature will soon fill this gap!</p> <p>on the downsides, custom pages cannot be added directly into a form!</p> <p> </p> <h3>Reference</h3> <ul> <li><a href="https://powerapps.microsoft.com/en-us/blog/custom-pages-for-converging-model-driven-apps-and-canvas-apps/">Microsoft's annoucement</a></li> <li><a href="https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/model-app-page-overview">Microsoft's documentation</a></li> </ul> <h2 class="title">Custom Pages for converging Power Apps Model-Driven and Canvas</h2> </div> </div> <div class="field field--name-field-image field--type-image field--label-above"> <div class="field__label">Image</div> <div class="images-container clearfix"> <div class="image-preview clearfix"> <div class="image-wrapper clearfix"> <div class="field field--name-field-image field--type-image field--label-above field__item">/sites/default/files/2023-01/CustomPage.png</div> </div> </div> </div> </div> Tue, 17 Jan 2023 13:00:14 +0000 Danny Rodrigues Alves 450 at https://dynamics-chronicles.com Controls Customization Deep Dive PCF Power Apps Programming Tutorial https://dynamics-chronicles.com/article/custom-pages-converging-power-apps-model-driven-and-canvas#comments Dynamics 365 Calendar View Presentation https://dynamics-chronicles.com/article/dynamics-365-calendar-view-presentation <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Dynamics 365 Calendar View Presentation</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/amaury-veron" lang="" about="/user/amaury-veron" typeof="schema:Person" property="schema:name" datatype="" class="username">Amaury Veron</a></span> <span property="schema:dateCreated" content="2021-06-30T12:48:28+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 06/30/2021 - 14:48</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><p><em>Dynamics 365 Calendar View Presentation: </em></p> <p>We want to display a Calendar for the Table Appointment. Here is the final appearance you can get:</p> <img alt="Calendar Appearance" data-entity-type="file" data-entity-uuid="8fdcd3b0-574a-4c91-a10f-7e447dd96181" height="531" src="/sites/default/files/inline-images/Calendar%20Appearance.png" width="1090" class="align-center" /> <p>Nice look isn't it ?</p> <p>When using the Calendar, you are not saying goodbye to the other "usual" Views of the Table. You can still switch to any other View:</p> <img alt="Switch View" data-entity-type="file" data-entity-uuid="0732b740-d966-4a74-b8fc-eddf447412a9" src="/sites/default/files/inline-images/Switch%20View.png" class="align-center" /> <p> </p> <p>To configure the Calendar, create a View as usual. In the editor, select "Custom Control":</p> <img alt="Dynamics 365 Calendar View Presentation" data-entity-type="file" data-entity-uuid="1d80c390-bb8e-4878-b8d1-54fda51ed341" height="589" src="/sites/default/files/inline-images/Calendar%20Config.png" width="1088" class="align-center" /> <p>Click "Add Control" and choose "Calendar Control V2". Select the supports on which you want to display the View as a Calendar.</p> <p>Then, you can configure 4 properties for the Calendar. Each property is set to a Column of the Table.</p> <ul> <li>"Start Date": when the visual for the Row should start on the Calendar. For Table "Appointment", this could for instance be set to field "scheduledstart" or "actualstart"</li> <li>"Description": the description displayed on the visual of the Row. For Table "Appointment", this could for instance be set to field "Subject"</li> <li>"End Date": when the visual for the Row should end on the Calendar. For Table "Appointment", this could for instance be set to field "scheduledend" or "actualend"</li> <li>"Duration" (Optional): the duration displayed on the quick view of the Visual. For Table "Appointment", this could for instance be set to field "scheduledduration"</li> </ul> <p> </p> <p>Clicking on the visual shows this quick view:</p> <p> </p> <img alt="Dynamics 365 Calendar View Presentation" data-entity-type="file" data-entity-uuid="f81f80e2-e6c5-4b6f-8e87-76530ab1364c" src="/sites/default/files/inline-images/Quick%20View.png" class="align-center" /> <p>The record can be opened by clicking on "More Details". </p> <p>A limitation is that this view can't be customized.</p> <p> </p> <p>You could use the Calendar View for any Table. For our Use Case here, we could also have:</p> <ul> <li>Created the View on the Table Activity</li> <li>Filtered the View to keep only the Activities of "Activity Type" = "Appointment"</li> </ul> <p>We could of course not filter the View if we want, and have a Calendar View with all Activities in it.</p> <p> </p> <p>Hope you will enjoy this feature !</p> <h2 class="title">Dynamics 365 Calendar View Presentation</h2> </div> </div> Wed, 30 Jun 2021 12:48:28 +0000 Amaury Veron 410 at https://dynamics-chronicles.com Controls Customization First Step PCF https://dynamics-chronicles.com/article/dynamics-365-calendar-view-presentation#comments Power Apps PCF NN DropDown Overview https://dynamics-chronicles.com/article/power-apps-pcf-nn-dropdown-overview <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Power Apps PCF NN DropDown Overview</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/stephan-drouard" lang="" about="/user/stephan-drouard" typeof="schema:Person" property="schema:name" datatype="" class="username">Stéphan Drouard</a></span> <span property="schema:dateCreated" content="2021-02-09T21:01:37+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 02/09/2021 - 22:01</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><p>This trick is dedicated to a very useful PCF NN DropDown</p> <p>Today, the only solution with CRM to display a list of Many-to-Many relationship items into a form is actually to display it as a list.</p> <p><img alt="PCF NN DropDown" data-entity-type="file" data-entity-uuid="9ab8a8af-0666-4f76-a329-f8bcdb0ae22a" src="/sites/default/files/inline-images/nndropdown%202.png" /></p> <p>You can also have a new button which will open a new form in a popup but let's be honest, it is not really user friendly.</p> <p>That is where the PCF NN DropDown steps to the floor !</p> <p>With it, you will be able to turn a Many-to-Many relationship into a multiselect dropdown.</p> <p><img alt="PCF NN DropDown" data-entity-type="file" data-entity-uuid="c5476421-a2d7-40df-bb12-a4782243e606" src="/sites/default/files/inline-images/nndropdown.png" /></p> <p>The bonus is that with an input parameter, you can add a filter to the control to search your item !</p> <p>It has been developed by Niels Minnee and it is available on <a href="https://pcf.gallery/nndropdown/">pcf.gallery</a>.</p> <p>If you need to install it, the managed solution is available. But if you want to modify it, the sources are also available and you can regenerate managed or unmanaged solution as you wish. You can use <a href="https://dynamics-chronicles.com/article/deep-dive-pcf-powerapp-control-framework-step-step-tuto">this tutorial</a> to help you doing it.</p> <p>Enjoy !</p> <h2 class="title">PCF NN DropDown</h2> </div> </div> Tue, 09 Feb 2021 21:01:37 +0000 Stéphan Drouard 206 at https://dynamics-chronicles.com PCF Customization Controls Power Apps https://dynamics-chronicles.com/article/power-apps-pcf-nn-dropdown-overview#comments Dataverse / Dynamics 365 Timer Control https://dynamics-chronicles.com/article/dataverse-dynamics-365-timer-control <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Dataverse / Dynamics 365 Timer Control</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/amaury-veron" lang="" about="/user/amaury-veron" typeof="schema:Person" property="schema:name" datatype="" class="username">Amaury Veron</a></span> <span property="schema:dateCreated" content="2020-12-18T10:33:32+00:00" class="field field--name-created field--type-created field--label-hidden">Fri, 12/18/2020 - 11:33</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><p>Dynamics 365 Timer Control in the Forms. The Timer Control can for instance be used to let a user know the time he has left to complete a task.</p> <p>A very common application of the Timer Control is for SLAs of Cases. It could help your User know how long he has to meet the SLA conditions for a Case!</p> <p>You can add several Timer Controls per Form, for any Entity.</p> <p>To insert it in a Form, go to Form customisation interface and click Insert -&gt; Timer Control:</p> <img alt="Dynamics 365 Timer Control" data-entity-type="file" data-entity-uuid="0d31b98b-1ec2-4a11-bf1b-fd320fe12231" height="563" src="/sites/default/files/inline-images/Insert%20Timer%20Control.png" width="1045" class="align-center" /> <p> </p> <p>A window opens with different properties to fill:</p> <img alt="Dynamics 365 Timer Control" data-entity-type="file" data-entity-uuid="c58ebbbb-0c83-4f1b-8e7b-0e73598b5d39" height="569" src="/sites/default/files/inline-images/Timer%20Control%20Form.png" width="1054" class="align-center" /> <p>You first need to fill in a Name for the control, and a Label for it. The Label will be displayed on the Form.</p> <p>Then, you have two other mandatory fields:</p> <p>- Failure Time Field:</p> <p>Here you can select a DateTime field. It is the deadline for the User to perform a Task.</p> <p>The Timer will show a countdown to this DateTime, until it is reached. If the DateTime is reached and exceeded, the Timer will go up and be displayed in red.</p> <p> </p> <p>- Success Condition:</p> <p>You select here a Success Condition. You specify an Option Set of the entity and one of the values of the Option Set. If the Option Set is set to this value for the record, the Timer will show a status "Succeeded":</p> <p> </p> <p>Here is the appearance of the Timer on the Form:</p> <img alt="Dynamics 365 Timer Control" data-entity-type="file" data-entity-uuid="d96a8fe0-1fb4-420f-ad0b-e8caadad4911" height="400" src="/sites/default/files/inline-images/Case%20Timer.png" width="1061" class="align-center" /> <p>If the Failure Time field is past, the Timer will go up and be shown in red:</p> <img alt="Timer Time past" data-entity-type="file" data-entity-uuid="683fabc4-c729-4d36-9d12-1ca4504bd3cd" src="/sites/default/files/inline-images/Timer%20Time%20past.png" class="align-center" /> <p>If the Success Condition is met, the Timer is replaced by the "Succeeded" message :</p> <img alt="Dynamics 365 Timer Control" data-entity-type="file" data-entity-uuid="aa97b99b-901f-4634-af7f-36556d95cefa" src="/sites/default/files/inline-images/Timer%20Succeeded.png" class="align-center" /> <p> </p> <p>There are also optional fields in the configuration of the Timer. For each of them, you also select an option set and one of its values.</p> <p>- Failure Condition:</p> <p>If condition is met, the Timer shows "Expired":</p> <img alt="Dynamics 365 Timer Control" data-entity-type="file" data-entity-uuid="66a12e0c-239e-4da0-9c72-923023c149e1" src="/sites/default/files/inline-images/Timer%20Expired.png" class="align-center" /> <p>- Warning Condition:</p> <p>If condition is met, the Timer shows "Nearing Expiry" under the countdown:</p> <img alt="Timer Nearing Expiry" data-entity-type="file" data-entity-uuid="12068184-a1d4-4f0a-9f74-7b8a1785c901" src="/sites/default/files/inline-images/Timer%20Nearing%20Expiry.png" class="align-center" /> <p>If the Failure Time is past, it isn't shown.</p> <p> </p> <p>- Cancel Condition:</p> <p>If condition is met, the Timer shows "Canceled":</p> <img alt="Timer Canceled" data-entity-type="file" data-entity-uuid="8891e8be-0e24-4507-b029-03dca8ec259c" src="/sites/default/files/inline-images/Timer%20Canceled.png" class="align-center" /> <p> </p> <p>- Pause Condition:</p> <p>If condition is met, the Timer shows "Paused":</p> <img alt="Timer Paused" data-entity-type="file" data-entity-uuid="7efa2d69-74bb-4e32-9c51-ca0661881c0f" src="/sites/default/files/inline-images/Timer%20Paused.png" class="align-center" /> <p> </p> <p>Hope you will find use to this nice Control !</p> <h2 class="title">Dynamics 365 Timer Control</h2> </div> </div> Fri, 18 Dec 2020 10:33:32 +0000 Amaury Veron 179 at https://dynamics-chronicles.com Customization Controls https://dynamics-chronicles.com/article/dataverse-dynamics-365-timer-control#comments Canvas App as modal box in Dynamics 365 https://dynamics-chronicles.com/article/canvas-app-modal-box-dynamics-365 <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Canvas App as modal box in Dynamics 365</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/amaury-veron" lang="" about="/user/amaury-veron" typeof="schema:Person" property="schema:name" datatype="" class="username">Amaury Veron</a></span> <span property="schema:dateCreated" content="2020-10-26T14:40:29+00:00" class="field field--name-created field--type-created field--label-hidden">Mon, 10/26/2020 - 15:40</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h4>Introduction</h4> <p>Canvas Apps can already be embedded in Dynamics 365 Model-Driven Apps - in Forms - and that's awesome!</p> <p>Today's Trick is about a new feature that allows to use Canvas App as modal boxes in Model-Driven Apps !</p> <p>It uses the new Smart Button "Open Dialog" of the Ribbon Workbench. </p> <p>Basically, you will create an "Open Dialog" button in the Ribbon and link it to your Canvas App. When the user clicks the button in the Model-Driven App, the Canvas App will open as a modal box.</p> <h4>Install Smart Buttons</h4> <p>For this integration, the first step is to install in your environment the solution containing the Smart Buttons for the Ribbon Workbench.</p> <p>You can find the latest version of the solution here: <a href="https://github.com/scottdurow/RibbonWorkbench/releases ">https://github.com/scottdurow/RibbonWorkbench/releases </a></p> <p><em>Important Note:</em></p> <p>Unlike the Ribbon Workbench Solution, when you deploy to production you will also need to install the smart buttons solution since it contains the necessary JavaScript for them to work. </p> <h4>Create Canvas App</h4> <p>Now, time to create your Canvas App.</p> <p>There are just a few tips to know for this integration:</p> <ul> <li>The "Open Dialog" Smart Button will pass 2 parameters to the Canvas App <ul> <li>recordId: This parameter contains the GUID of the record selected in the Model-Driven App</li> <li>recordLogicName: This parameter contains the logical name of the record selected in the Model-Driven App</li> </ul> </li> </ul> <p>Then, you can for instance access the record in the Canvas App with this formula:</p> <pre> <strong>LookUp(Cases, Case = Param("recordId")))</strong> </pre> <ul> <li>The Smart Button listens for the <strong>Exit()</strong> function in the Power Apps: if you call this function, the modal box will close. So, you can for instance use this function on a Cancel button.</li> </ul> <p>Knowing these few things, you can now let your imagination go to create advanced Modal Boxes using Canvas Apps!</p> <img alt="Canvas App as modal box" data-entity-type="file" data-entity-uuid="eace6347-ca41-4283-aa6f-0c42cc1d707a" height="433" src="/sites/default/files/inline-images/Canvas%20App%20as%20modal%20box_1.png" width="807" class="align-center" /> <h4>Create Smart Button</h4> <p>Now, go to your Ribbon Workbench.</p> <p>Create a new "Open Dialog" Smart Button and place it where you want:</p> <img alt="Ribbon Workbench" data-entity-type="file" data-entity-uuid="7b9a7deb-48cb-4db6-b800-ac260aa0c7b8" height="384" src="/sites/default/files/inline-images/Ribbon%20Workbench.png" width="812" class="align-center" /> <p>Add input parameters:</p> <img alt="New Open Dialog Smart Button" data-entity-type="file" data-entity-uuid="04d65e27-7fe6-4d0f-92c9-a123823cd31d" height="386" src="/sites/default/files/inline-images/New%20Open%20Dialog%20Smart%20Button.png" width="814" class="align-center" /> <p>You will be able to:</p> <ul> <li>Give a Title for the button</li> <li>Give the URL of your Canvas App <ul> <li>You can find it in the Power Apps portal, going to the section "Details" of your Canvas App</li> <li>A great possibility is to give as input an Environment variable with following syntax: {%schema_name%}. Where schema_name must be replaced by the schema name of the environment variable. This allows to point to a different Canvas App depending on the environment</li> </ul> </li> <li>A width for the modal box</li> <li>A height for the modal box</li> <li>A Header for the modal box</li> </ul> <h4>Conclusion</h4> <p>This new feature looks really awesome. With this new feature, it is possible to create custom modal boxes in your Model-Driven apps, with very low code involved!</p> <p>The Ribbon Workbench has introduced other Smart Buttons. There may be the subjects of future tricks. So stay tuned if you are interested!</p> </div> </div> Mon, 26 Oct 2020 14:40:29 +0000 Amaury Veron 139 at https://dynamics-chronicles.com Customization Power Apps Controls Tools https://dynamics-chronicles.com/article/canvas-app-modal-box-dynamics-365#comments New Feature: Related Records in a Dialog https://dynamics-chronicles.com/article/new-feature-related-records-dialog <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">New Feature: Related Records in a Dialog</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/stephan-drouard" lang="" about="/user/stephan-drouard" typeof="schema:Person" property="schema:name" datatype="" class="username">Stéphan Drouard</a></span> <span property="schema:dateCreated" content="2020-06-16T09:30:28+00:00" class="field field--name-created field--type-created field--label-hidden">Tue, 06/16/2020 - 11:30</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h3>Presentation</h3> <p>With the arrival of the new 2020 release Wave 1, a very useful feature is now available on D365.</p> <p>Before when a user wanted to access the record's form from a lookup, or a subgrid for example, he was forced to leave the current form.</p> <p>With the new release, you will be able, thanks to a little piece of code, to display the desired form into a customized dialog. From this opened form dialog, you could create a new record or edit an existing one. A nice thing to note is that the tab control to navigate in the form will be usable.</p> <p>To integrate this new feature, D365 devs will create a javascript script where they will have the possibility to define the appearance and the positionning of the dialog.</p> <p>Let's see an example with this following script</p> <pre> <code class="language-javascript">var pageInput = { pageType: "entityrecord", entityName: "account", formType: 2, }; var navigationOptions = { target: 2, width: { value: 50, unit:"%" }, position: 1 }; Xrm.Navigation.navigateTo(pageInput, navigationOptions);</code></pre> <p>The code displays a dialog to create a new record of type Account. The dialog will be centered and with a width of 50% of the window.</p> <p><img alt="Open a new record" src="https://docs.microsoft.com/en-US/powerapps/developer/model-driven-apps/media/open-new-record-mfd.png" /></p> <p>You can also modify the navigationOptions to change the dialog position. Let's change it with:</p> <pre> <code class="language-javascript">var navigationOptions = { target: 2, width: { value: 500, unit:"px" }, position: 2 }; </code></pre> <p>In this case, the dialog will be on the right of the screen with a width of 500px.</p> <p><img alt="Open an existing record on side pane" src="https://docs.microsoft.com/en-US/powerapps/developer/model-driven-apps/media/open-record-side-pane-mfd.png" /></p> <h3>References</h3> <p>You can find more examples on this page:</p> <ul> <li><a href="https://docs.microsoft.com/en-US/powerapps/developer/model-driven-apps/customize-entity-forms#open-main-form-in-a-dialog-using-clientapi">https://docs.microsoft.com/en-US/powerapps/developer/model-driven-apps/customize-entity-forms#open-main-form-in-a-dialog-using-clientapi</a></li> </ul> <p>If you want to know more about the <em>navigateTo</em> function</p> <ul> <li><a href="https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto">https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/navigateto</a></li> </ul> </div> </div> Tue, 16 Jun 2020 09:30:28 +0000 Stéphan Drouard 68 at https://dynamics-chronicles.com Customization Programming Controls https://dynamics-chronicles.com/article/new-feature-related-records-dialog#comments Editable Grids, a usefull PCF control offered by Microsoft https://dynamics-chronicles.com/article/editable-grids-usefull-pcf-control-offered-microsoft <span property="schema:name" class="field field--name-title field--type-string field--label-hidden">Editable Grids, a usefull PCF control offered by Microsoft</span> <span rel="schema:author" class="field field--name-uid field--type-entity-reference field--label-hidden"><a title="View user profile." href="/user/danny-rodrigues-alves" lang="" about="/user/danny-rodrigues-alves" typeof="schema:Person" property="schema:name" datatype="" content="Danny Rodrigues Alves" class="username">Danny Rodrigue…</a></span> <span property="schema:dateCreated" content="2020-05-13T11:24:11+00:00" class="field field--name-created field--type-created field--label-hidden">Wed, 05/13/2020 - 13:24</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-above"> <div class="field__label">Body</div> <div property="schema:text" class="field__item"><h4>Description </h4> <p>In previous releases of Dynamics 365 or Dynamics CRM, users couldn’t enter data directly in lists/views or subgrids. They had to click the record to open it in a form, edit the data, and then save, which required multiple clicks. <em><strong>Editable Grids</strong></em> give users the ability to perform in-line editing directly from a list or sub-grid.</p> <p>Visually, an Editable Grid looks just like a regular read-only grid. Almost all types of fields can be updated via such grid, exception made for Customer lookups, Owner, composite address fields, and state/status fields. Like the classical read-only grids, filtering columns, pagination, and resizing columns capabilities are also offered. It works with OOB entities, custom ones, personal views, mobile clients, …</p> <p>As the goal of editable grids is to make data entry more efficient, several <a href="https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/basics/keyboard-shortcuts#editable-grids-views">keyboard shortcuts</a> are offered and may be used to gain time and productivity.</p> <figure role="group" class="caption caption-img align-right"> <img alt="Figure 1: Group By feature" data-entity-type="file" data-entity-uuid="c09397f9-037c-4b79-a03f-059d98cbca71" src="/sites/default/files/inline-images/1_7.png" /> <figcaption>Figure 1: <em>Group By</em> feature</figcaption> </figure> <p>Editable Grids also give the possibility to <em>Group By</em> records based on some fields. For example, in <em>Figure 1</em>, the record <em>Payment Plans</em> are group by the option set field <em>Frequency </em>(values are Bi-annual, Bi-monthly, Monthly, and null). Note that it’s possible to enable an editable grid for an entity but disable the grouping feature.</p> <p>Some other points regarding Editable Grids:</p> <ul> <li>If a field is set as read-only in the entity configuration, Editable Grid takes it into account.</li> <li>Security Roles are obviously considered.</li> <li>There are no business rules that are fired…</li> <li>… but it’s possible to make some JavaScript function on such grid.</li> <li>Move columns around in the view by dragging and dropping. Please note, these persist across sessions and users, i.e. if I move a column, it is moved for all users, and will still be like that when I log out and back in again.</li> <li>It’s not possible to change a value on a field of a parent entity.</li> </ul> <p>Finally, note that changes are some saved automatically! There is a save icon on the top right of the view and a little message on the bottom left warning users about <em>Unsaved Changes</em>.</p> <h4>Configuration </h4> <p>Editable Grids can be set up in two ways:</p> <ul> <li>Either for a specific sub-grid in a form <ul> <li>In the customization of the form, select the sub-grid and open the Controls tab.</li> <li>There, add the <em>Editable Grid</em> control.<br /> <img alt="2" data-entity-type="file" data-entity-uuid="4ea82f02-d876-4824-8af3-a2982e2b15a4" height="203" src="/sites/default/files/inline-images/2_8.png" width="321" /><br />  </li> </ul> </li> <li>Either for an entire Entity <ul> <li>In the <em>Customizations</em>, click on the entity and go to the <em>Controls</em> tab.</li> <li>There, add the <em>Editable Grid</em> control.<br /> <img alt="3" data-entity-type="file" data-entity-uuid="f440c4fc-c944-4a7e-99e5-04666f0e1b75" height="109" src="/sites/default/files/inline-images/3_7.png" width="582" /><br />  </li> </ul> </li> </ul> <p>Therefore, it’s not possible to apply it to just some views and not to other ones.</p> <h4>Take-away Points</h4> <ul> <li>Editable Grids enable in-line editing directly in a view or a subgrid.</li> <li>Security Roles still apply.</li> <li>It can be set up either at the Entity-level for all views or at the Form-level.</li> <li>It can be customized with JavaScript.<br />  </li> </ul> <p> </p> </div> </div> Wed, 13 May 2020 11:24:11 +0000 Danny Rodrigues Alves 60 at https://dynamics-chronicles.com Controls Customization PCF https://dynamics-chronicles.com/article/editable-grids-usefull-pcf-control-offered-microsoft#comments