{"id":20946,"date":"2019-10-30T11:40:00","date_gmt":"2019-10-30T11:40:00","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=20946"},"modified":"2022-09-02T16:25:32","modified_gmt":"2022-09-02T10:55:32","slug":"how-to-use-navigate-to-method-of-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/10\/how-to-use-navigate-to-method-of-dynamics-365-crm\/","title":{"rendered":"How to Use \u2018Navigate To\u2019 Method of Dynamics 365 CRM"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>In this blog, we will take a look at \u2018<strong>navigateTo()\u2019 <\/strong>method inside new namespace <strong>Navigation <\/strong>of new <strong>Xrm Object Model<\/strong>.<\/p>\n<p>The\u00a0<strong>Xrm<\/strong>\u00a0object is globally available to use in your code without having to use the execution context in Client API.<\/p>\n<p style=\"text-align: justify;\">Recently we received a request from client to add button on the home page of Lead. Here, the button should grab the first Lead from specific Leads and assign it to another user on the basis of business logic. And after we assign Lead to new users it should be removed from the home page grid subsequently. But we cannot refresh the home page grid. So in this case we can use \u2018<strong>navigateTo\u2019<\/strong> method to navigate to the home page with specific view once the Lead is assigned to other users. The home page grid will show latest data if we use this method.<\/p>\n<p><strong><u>navigateTo()<\/u>:<\/strong><\/p>\n<p>This method is available under new namespace\u00a0<strong>Navigation\u00a0<\/strong>using which we can navigate to the main entity view.<\/p>\n<p>Also we can specify the view to load. If you don&#8217;t specify the view, it will navigate to the default main view for the entity.<\/p>\n<p><strong>Syntax<\/strong>:<\/p>\n<p>Xrm.Navigation.navigateTo(pageInput).then(successFunction,errorFunction);<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p><strong>1. pageInput<\/strong><strong>:<\/strong><\/p>\n<p><strong>&#8211; <\/strong>type: Object<\/p>\n<p><strong>&#8211; <\/strong>Required: Yes<\/p>\n<p><strong>&#8211;<\/strong> Attributes: The object contains the following attributes:<\/p>\n<ol>\n<li><strong>pageType<\/strong>: String. Specify \u201c<strong>entitylist<\/strong>\u201d.<\/li>\n<li><strong>entityName<\/strong>: String. Specify logical name of the entity.<\/li>\n<li><strong>viewId: <\/strong>(Optional) String. The ID of the view to load. If you don\u2019t specify it, navigates to the default main view for the entity.<\/li>\n<li><strong>viewType: <\/strong>(Optional) String. Type of view to load. Specify \u201c<strong>savedquery<\/strong>\u201d or \u201c<strong>userquery<\/strong>\u201d<\/li>\n<\/ol>\n<p><strong>2. successFunction:<\/strong><\/p>\n<p><strong>&#8211; <\/strong>type: function<\/p>\n<p><strong>&#8211; <\/strong>Required: No<\/p>\n<p><strong>&#8211;<\/strong> Description: Function to execute on successful navigation to page.<\/p>\n<p><strong>3. errorFunction:<\/strong><\/p>\n<p><strong>&#8211; <\/strong>type: function<\/p>\n<p><strong>&#8211; <\/strong>Required: No<\/p>\n<p><strong>&#8211;<\/strong> Description: Function to execute when operation fails.<\/p>\n<blockquote><p><strong>Note: <\/strong>Xrm.Navigation.navigateTo() method is supported only on the Unified Interface.<\/p><\/blockquote>\n<h3><strong>navigateTo() method without optional attributes<\/strong><strong>:<\/strong><\/h3>\n<pre class=\"lang:default decode:true \">Xrm.Navigation.navigateTo({ <strong>pageType<\/strong>: \"entitylist\", <strong>entityName<\/strong>: \"lead\" }).then(\r\n\r\nfunction (result) {\r\n\r\n\/\/Success\r\n\r\n},\r\n\r\nfunction (error) {\r\n\r\n\/\/Error\r\n\r\n}\r\n\r\n);<\/pre>\n<h3><strong>Output<\/strong><strong>: <\/strong><\/h3>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20947\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To.png\" alt=\"Navigate To\" width=\"1440\" height=\"703\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To.png 1440w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To-300x146.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To-768x375.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To-1024x500.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/1Navigate-To-660x322.png 660w\" sizes=\"(max-width: 1440px) 100vw, 1440px\" \/><\/p>\n<p><strong>Note: <\/strong>If we do not specify <strong>view ID <\/strong>it will navigate to the default main view of the entity as shown in the above screen shot.<\/p>\n<h3><strong>navigateTo() method with optional attributes:<\/strong><\/h3>\n<pre class=\"lang:default decode:true \">Xrm.Navigation.navigateTo({ <strong>pageType<\/strong>: \"entitylist\", <strong>entityName<\/strong>: \"lead\", <strong>viewId<\/strong>: \"65ffaf9a-e8c5-432d-860b-32f841b00d87\", <strong>viewType<\/strong>: \"savedquery\" }).then(\r\n\r\nfunction (result) {\r\n\r\n\/\/Success\r\n\r\n},\r\n\r\nfunction (error) {\r\n\r\n\/\/Error\r\n\r\n}\r\n\r\n) ;<\/pre>\n<h3><strong>Output<\/strong><strong>:<\/strong><\/h3>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20948\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to.png\" alt=\"Navigate to\" width=\"1424\" height=\"695\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to.png 1424w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to-300x146.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to-768x375.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to-1024x500.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/2Navigate-to-660x322.png 660w\" sizes=\"(max-width: 1424px) 100vw, 1424px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>In this way we can use <strong>\u2018navigateTo\u2019<\/strong> method of Dynamics 365 CRM to navigate to the home page with specific view.<\/p>\n<p>Reference &#8211; <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/model-driven-apps\/clientapi\/reference\/xrm-navigation\/navigateto\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/model-driven-apps\/clientapi\/reference\/xrm-navigation\/navigateto<\/a><\/p>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\">Generate Your Own New Leads Within Microsoft Dynamics 365 CRM<\/div><\/div><\/h2>\n<p><em>Contact us for a <a href=\"https:\/\/www.maplytics.com\/maplytics-download\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">demo<\/a> to know more about how <a href=\"https:\/\/www.maplytics.com\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">Maplytics<\/a> can help you to generate new leads from within Microsoft Dynamics 365 CRM.<\/em><\/p>\n<p><em><a href=\"https:\/\/www.maplytics.com\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">Maplytics<\/a> is a 5-star rated, preferred business app on the <a href=\"https:\/\/appsource.microsoft.com\/en-us\/product\/dynamics-365\/inogic.f6f3c73f-29de-4fa8-a396-87ea8a07b6c4?tab=Overview\" target=\"_blank\" rel=\"noopener\">Microsoft AppSource<\/a> that is Certified for Microsoft Dynamics 365 (CfMD) and comes with powerful features like Appointment Planning, Sales Routing, Territory Management, Heat Maps, Geo-analytical Dashboards and more that empower organizations to add more value to their CRM data, improve sales &amp; service processes, and achieve high ROI.<\/em><\/p>\n<p><em>Get your <a href=\"https:\/\/www.maplytics.com\/maplytics-download\/?utm_source=highvisits&amp;utm_medium=technicalblog&amp;utm_campaign=hMaplytics\" target=\"_blank\" rel=\"noopener\">free trial<\/a> from our Website or <a href=\"https:\/\/appsource.microsoft.com\/en-us\/product\/dynamics-365\/inogic.f6f3c73f-29de-4fa8-a396-87ea8a07b6c4?tab=Overview\" target=\"_blank\" rel=\"noopener\">Microsoft AppSource<\/a>!<\/em><\/p>\n<p><em>&#8216;If data is the new oil, location intelligence is ??\u201d<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we will take a look at \u2018navigateTo()\u2019 method inside new namespace Navigation of new Xrm Object Model. The\u00a0Xrm\u00a0object is globally available to use in your code without having to use the execution context in Client API. Recently we received a request from client to add button on the home page of\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/10\/how-to-use-navigate-to-method-of-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":20951,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18,19],"tags":[1970,1969],"class_list":["post-20946","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365-v9-2","category-dynamics-crm","tag-navigate-to","tag-navigate-to-method-dynamics-365-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=20946"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20946\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/20951"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=20946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=20946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=20946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}