Citizen Developer
Timespan
explore our new search
Embed Audit History in Model-Driven App Forms Easily
Image Source: Shutterstock.com
Model-Driven App
Feb 1, 2024 5:00 PM

Embed Audit History in Model-Driven App Forms Easily

by HubSite 365 about Linn Zaw Win [MVP]

Citizen DeveloperModel-Driven AppLearning Selection

Seamlessly Integrate Audit History in Model-Driven Apps with iFrame & JavaScript

Key insights

 

Embedding Audit History Directly in Model-Driven Apps: Users can integrate audit history on a table's form in Model-Driven App with an iFrame control and JavaScript, improving user experience by preventing multiple clicks to access audit history.

  • Streamlining Access: By utilizing an iFrame control and JavaScript, audit history can be displayed directly on a form or under a separate tab, eliminating the need for users to navigate through multiple tabs.
  • Legacy UI Consideration: The current Audit History is a legacy UI feature within the Unified Interface. Users must be prepared to update this functionality when Microsoft fully integrates Audit History into the Unified Interface experience.
  • Setting up iFrame: To embed audit history, add an iFrame to the form by selecting the External website component in the form designer, and customize its URL using JavaScript.
  • JavaScript Implementation: A JavaScript function is necessary to dynamically populate the iFrame with the correct entity ID and object type code parameters, which can be triggered by the form's onLoad event or through TabStateChange if placed on a different tab.
  • Display Limitations: The custom audit iFrame may not show certain features like the Filter dropdown and Delete Change History button, limiting the ability to filter audit details or delete change records directly from the iFrame.
 

Expanding on Embedding Audit Histories

Understanding how to embed an audit history into a form in a Model-Driven App using an iFrame and JavaScript is pivotal for developers and administrators who aim to enhance user navigation and accessibility. This functionality not only streamlines the process of reviewing changes directly within the app but also addresses the need to handle certain aspects related to legacy UI within the evolving Microsoft Unified Interface. With the possibility of Microsoft updating the integration of audit histories, preparation for reimplementation highlights the importance of adaptability in using these technologies. Furthermore, the customization of audit history displays, although limited in filtering and deletion capabilities, points to ongoing opportunities for enhancing these features to meet user needs better. This approach represents a blend of leveraging existing infrastructure with innovative solutions to improve user experience in Model-Driven Apps.

 

How to Embed Audit History on a Form in Model-Driven App: This blog post by Linn Zaw Win [MVP] guides on embedding an audit history on a form's table using an iFrame control and JavaScript. By doing this, users won't have to navigate multiple times through the Related tab to view the Audit History.

To avoid multiple clicks to access Audit History, one can display it directly on the form or under a separate tab. This is achieved by adding an iFrame control and setting the URL of the iFrame using JavaScript. It enhances user accessibility and efficiency.

Note that the current Audit History interface is part of the legacy UI within the Unified Interface's hybrid experience. As Microsoft moves towards fully implementing the Audit History within the Unified Interface, developers might need to reapply this functionality to adapt to future updates.

To insert an iFrame into the form, choose the External website component in the form designer and input a placeholder URL. Naming the iFrame control is crucial as it will be referenced in the subsequent JavaScript code, for example, using "IFRAME_audit" as the control's name.

Embedding the Audit History requires JavaScript to set the entity ID and object type code parameters within the iFrame URL. This can be initialized from the Form OnLoad event or TabStateChange event. The JavaScript code provided outlines how to dynamically set the iFrame URL based on the form context and entity metadata.

However, there's a limitation to be noted. The Audit History displayed via the custom iFrame might not show certain elements like the Filter dropdown and Delete Change History button. This restriction means users cannot filter audit details by a specific column or delete the entire change history for a record directly from the iFrame.

What is Model-Driven Applications

Model-Driven Applications offer a dynamic and metadata-driven approach to application design within the Microsoft ecosystem. These types of applications are built primarily on top of the data model defined in Dataverse, allowing the structure and relationships of data to dictate the application's behavior and layout. The main benefit of this approach is its agility and flexibility, enabling non-developers to configure and adapt applications as business requirements evolve.

The use of Model-Driven Apps allows for rapid development cycles, as changes to the data model are reflected immediately in the application without the need for custom coding. This enables businesses to respond quickly to new opportunities or operational adjustments. Additionally, Model-Driven Apps integrate seamlessly with other Microsoft services, enhancing workflow automation and data consistency across the board.

Customizing user experiences is a key advantage of Model-Driven Apps. With minimal effort, different views, forms, and dashboards can be tailored to meet various user roles and needs, ensuring that relevant information is presented in a context-specific manner to each user. Security roles and permissions further extend this customization, allowing granular access control based on the organization's governance requirements.

Another significant feature is the incorporation of business logic and workflows directly into the application model. This allows for the automation of tasks, validation of data, and implementation of complex business processes without needing extensive programming knowledge. The result is an application that not only aligns with the business's current processes but is also adaptable enough to grow and change with the organization.

In conclusion, Model-Driven Apps offer a robust, flexible, and user-friendly approach to application development within the Microsoft ecosystem. By leveraging the power of Dataverse and the wider Microsoft platform, organizations can rapidly deploy customizable and scalable business applications that drive efficiency and support digital transformation initiatives.

 

Read the full article How to Embed Audit History on a Form in Model-Driven App

 

Model-Driven App - Embed Audit History in Model-Driven App Forms Easily

 

People also ask

How do you embed audit history directly into an entity form?

To embed audit history into an entity form, navigate to the Audit History page. For Chrome users, access developer tools by pressing Control + Shift + J, then locate the iframe within the elements tab. This iframe will be essential in creating a web resource aimed at embedding said IFRAME into your design.

How do I enable audit history?

Audit History can be enabled through ACCE.

How do I enable audit history in Dataverse table?

To enable audit history for your Dataverse environment, specific settings need to be adjusted within the environment's configuration.

How do I view audit history in dynamics?

To view the audit logs in Microsoft Dynamics CRM, you must have the appropriate permissions to manage auditing. Log in and navigate to Settings > Auditing > Audit Summary View. There, you can enable or disable filters to streamline the log viewing process. Additionally, audit logs can be accessed directly from a record for detailed scrutiny.

 

Keywords

Embed Audit History, Model-Driven App Form, Add Audit History, Model-Driven Application Tutorial, Integrate Audit History, Customize Model-Driven App, Dynamics 365 Audit, CRM Audit History Embedding, Audit Trail Model-Driven App, Implement Audit in Model Apps