• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Opening Main Form Dialog from a lookup field using navigateTo and OnLookupClickTag method

April 15, 2020   Microsoft Dynamics CRM

With the 2020 Release Wave 1 update, a new method was introduced to open a new or existing record in a Main Form Dialog. There is an existing blog post from our Product Group that introduced the feature HERE, as well as details in our Docs site HERE. Since it is already covered there, I won’t go into the details of the method itself. 

One example I did not see, was how you could do this from the click event of a lookup field. For example, there are many times it would be nice to open the record from a lookup field for a quick reference or overview of the record, without actually leaving the form you are on. It wasn’t too long ago that this wasn’t possible. Now, you can do this by using the OnLookupClickTag event documented HERE

Using a very simple example, I did this to the Regarding field of the Task form below

function taskLookupModalDialog(executionContext){
	regardingLookup(executionContext);
}

function regardingLookup(executionContext){

	formContext = executionContext.getFormContext();
	formContext.getControl('regardingobjectid').addOnLookupTagClick(context => {
    context.getEventArgs().preventDefault();
	const tagValue = context.getEventArgs().getTagValue();

    Xrm.Navigation.navigateTo({
        pageType: "entityrecord",
        entityName: tagValue.entityType,
        formType: 2,
		entityId: tagValue.id
    }, {
        target: 2,
        position: 1,
        width: {
            value: 80,
            unit: "%"
        }
    });
})

}

This event is added as an OnLoad event to the form where the lookup field exists.

8611.pastedimage1586782356531v1 Opening Main Form Dialog from a lookup field using navigateTo and OnLookupClickTag method

0763.pastedimage1586782365024v2 Opening Main Form Dialog from a lookup field using navigateTo and OnLookupClickTag method

6366.pastedimage1586782372810v3 Opening Main Form Dialog from a lookup field using navigateTo and OnLookupClickTag method;

Now, when you click on the Regarding field on the Task form, the record opens in a Dialog instead of navigating away from the Task form.

pastedimage1586782932127v4 Opening Main Form Dialog from a lookup field using navigateTo and OnLookupClickTag method

Thanks for reading!

Aaron Richards

Let’s block ads! (Why?)

Dynamics 365 Customer Engagement in the Field

Dialog, Field, form, from, Lookup, Main, Method, navigateTo, OnLookupClickTag, opening, using
  • Recent Posts

    • NOW, THIS IS WHAT I CALL AVANTE-GARDE!
    • Why the open banking movement is gaining momentum (VB Live)
    • OUR MAGNIFICENT UNIVERSE
    • What to Avoid When Creating an Intranet
    • Is Your Business Ready for the New Generation of Analytics?
  • Categories

  • Archives

    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited