Xrm.Page is deprecated. How do I use formContext in Dynamics 365

Introduction

Microsoft Dynamics CRM offers an object model of form elements that can be applied to manipulate data, change form object properties, or to analyze the contemporary state of the form or data in the form. This object model is called formcontext. In this blog post, we will learn why using formContext is better than using Xrm.Page.

Learn more about our CRM services.

Benefits of Using formContext

Few benefits of using the formcontext model are:

  • It is used to execute script on event triggers like form onLoad event.
  • It contains control form objects like data controls (text boxes, checkboxes, etc.), tabs, sections, etc.
  • It can be used to discover elements to show/hide.
  • It allows you to specify the names of elements from which to retrieve/store data values.
  • It provides namespaces to properties and access to a collection of fields and forms per entity.

The formcontext container provides properties and methods to work with the data on a form.

formcontext.data is the object that contains properties and methods to help us manipulate items in the form.

Elevate your Business with AlphaBOLD's Dynamics 365 Expertise!

Interested in how the deprecation of XRM and the introduction of FormContext can elevate your CRM system? Let AlphaBOLD be your guide to mastering Dynamics 365's advanced features.

Request a Demo

Understanding Attributes and Entities:

Attributes are the collection of non-entity data at the form. Items in this collection are the same as those of the attributes collection. However, they are not attributing to the form entity.

Entities provide properties and methods to retrieve information related to the entity record on the page, the preserve method, and an amassment of all the attributes included in the form.

Attribute data is constrained to attributes represented by fields on the form. Processes offer events, methods, and objects to interact with the business process flow data on a form.

Read more: Best Practices for Using Dynamics 365 Customer Insights – Journeys

Manipulating the UI with formcontext

The formcontext container provides properties and methods to work with the UI on a form. UI provides methods to retrieve information about the user interface and accumulations for several sub-components of the form. It provides each Control that is present on the form.

A control represents an HTML element present on the form. Some controls are bound to an attribute, while others can also represent unbound controls, including an IFRAME, Web resource, or a subgrid added to the form.

The formcontext.ui.formSelector allows you to work with form items where a form item is accessible to a specific user only because the user is associated with a particular security role. There is usually a single form in most cases, but in cases of multiple forms, methods for a form item can be used to change the form the user is viewing. Use the formSelector.Items are collected to return information about all the forms available to the user. formSelector is not available for tablets in Microsoft Dynamics 365.

Enhancing Navigation and Quick View Controls

Every item represents one of the to-be-had navigation options available inside the navigation bar for entities that have been up to date to the new user experience or on the left facet of the form for entities that have not been updated yet. It presents methods to interact with a form’s business process flow control.

It presents methods for gaining entry to all the quick view controls and its constituent controls at the Customer Engagement forms when using the brand-new form rendering engine (also called “turbo forms”).

A quick view control is a form added to a main form for Customer Engagement that allows you to view information about a related entity record in the main form. Information in constituent controls in a quick view control can’t be edited. The quickForms collection presents access to all the quick view controls on a form and has all the standard methods of the collections.

A tab is a group of sections on a page. It carries properties and methods to manipulate tabs and get rights of entry to sections in the tab through the collection of the section. Tab reflows the UI of the business process control.

Read more: Interactive Experience Dashboards in Dynamics 365 Customer Engagement

Step into the Future of CRM with Dynamics 365 and AlphaBOLD!

Partner with AlphaBOLD to venture into the future of customer relationship management. We're committed to helping you leverage the full power of Dynamics 365, ensuring your business adapts and thrives.

Request a Demo

Conclusion

So, all in all we can say that the CRM formContext Object Model is very broad, offers great functionality and has useful features.

If you have any questions or queries, leave a comment below. You can also connect with our BOLDEnthusiasts by clicking here. 

Explore Recent Blog Posts

Infographics show the 2021 MSUS Partner Award winner

Related Posts

Receive Updates on Youtube