Pre-Populate Fields in CRM with Xrm.Navigation Guide
Image Source:
Dynamics CRM
Mar 14, 2024 4:56 AM

Pre-Populate Fields in CRM with Xrm.Navigation Guide

by HubSite 365 about Linn Zaw Win [MVP]

Citizen DeveloperDynamics CRMLearning Selection

Master Xrm.Navigation.navigateTo for Pre-filled Forms in Dynamics 365

Key insights



  • Learn how to pre-populate fields with various data types (lookup, partylist, etc.) when opening a new table form using the Xrm.Navigation.navigateTo method.
  • The Microsoft Learn documentation lacks a code example for implementing the data object parameter to set default values when a form is opened in create mode.
  • Setting column values using parameters with Xrm.Navigation.navigateTo is different from Xrm.Navigation.openForm, requiring trial and error without specific examples or documentation.
  • This post provides a detailed code example to help you easily pre-populate any field using the Xrm.Navigation.navigateTo method.
  • The code example includes setting values for text, number, yes/no, date, choice, and lookup columns, offering comprehensive guidance on form customization.

Understanding Xrm.Navigation.navigateTo for Microsoft Dynamics 365 Customization

Customizing Microsoft Dynamics 365 forms by pre-populating fields when they are opened can significantly improve the user experience and data entry efficiency. The method Xrm.Navigation.navigateTo is a powerful tool provided by Microsoft Dynamics 365 to achieve this level of customization. It can handle a wide range of data types, such as lookups and party lists, and allows for sophisticated forms to be set up with default values.

However, the technical documentation available often falls short by not providing clear, practical examples on how to implement these customizations, especially for specific scenarios like creating new records with pre-set field values. This gap makes it challenging for developers and customizers to utilize these features to their full potential, leading to unnecessary trial and error.

This blog post bridges that gap by offering a detailed code example to demonstrate how one can use Xrm.Navigation.navigateTo to open new record forms with pre-populated fields. By defining a data object with key-value pairs and setting up parameters and navigation options, developers can tailor the Dynamics 365 user interface to meet various business needs efficiently. This approach not only enhances the appeal of the application but also streamlines processes, making data entry tasks less cumbersome for the end-users.

Read the full article Open New Record Form with Pre-populated Fields Using Xrm.Navigation.navigateTo




Learn how to open a new record form with pre-populated fields using Xrm.Navigation.navigateTo in Dynamics CRM. This post explains how to fill in fields with different data types like lookup and partylist when opening a new table form.

The Microsoft Learn documentation on navigateTo (Client API reference) doesn't provide a code example for implementing the data object parameter to set default field values in creation mode. This post aims to bridge that gap by offering a practical code sample.

By using Xrm.Navigation.navigateTo, you can pre-populate fields differently from the Xrm.Navigation.openForm method. The challenge of missing documentation and code examples makes this solution especially useful. Below is a code example to help you easily pre-populate any field with the navigateTo method.

Code Example

In the given code snippet, important steps are outlined for setting up the data object with key-value pairs for various column types and performing navigation with customized options. This code enables the creation of a new contact record with predefined information in Dynamics CRM.

  • Text, Number, Yes/No, Date, Choice: Defines data for different column types including a text column for subjects, a number column for page counts, and more.
  • Lookup Columns: Setup for both single and multiple lookup columns to define relationships.
  • Page Input and Navigation Options: Configuration for the entity record page and navigation display options.

The method utilizes formContext and data objects to populate fields such as 'subject', 'numberofpages', and 'scheduledend' with predefined values. It exemplifies how to navigate to the desired form and create records with specific data in Dynamics CRM.

A special acknowledgment to Arjun Musuvathy for inspiring this insightful post. His suggestion has led to a valuable resource for Dynamics CRM users looking to enhance their record creation process.


People also ask

How do I automatically create records in Microsoft Dynamics 365?

To configure Microsoft Dynamics 365 for automatic record creation, navigate through Settings to Service Management. Here, you'll find the option for Automatic Record Creation and Update Rules. By opening the rule you wish to enable and selecting 'Activate' from the command bar, you’ll successfully activate the rule. Notably, for any given source type except email, you are allowed to have two record creation and update rules active concurrently—one that incorporates a queue and another that does not.

How do I enable quick create form in Dynamics 365?

To activate the quick create form feature within Dynamics 365, you should begin by accessing the system customization section, typically found under 'Settings' > 'Customizations.' Within this area, search for the entity you intend to modify. On the entity definition page, ensure to check the 'Allow quick create' option to enable the functionality for that specific entity.

How to open quick create form using JavaScript?

To open a quick create form in Dynamics 365 using JavaScript, for instance, if one needs to open the Account quick create form without specifying any parameters, the syntax would look like this: var params = {}; Xrm.Utility.openQuickCreate("account", null, params). This command will initiate the quick create form for an account entity.

What is the ARC rule in dynamics?

Within the Dynamics 365 ecosystem, an Automatic Record Creation rule, or ARC Rule, stands as a straightforward, no-code solution designed to facilitate the creation or updating of records by monitoring an Activity Table. This allows for efficient and automated management of records based on specific criteria and activities logged within Dynamics 365.



Xrm.Navigation.navigateTo, Pre-populate fields, Open New Record Form, Dynamics 365 JavaScript, CRM form automation, Set field values CRM, NavigateTo Dynamics example, Customize entity form Dynamics