{"id":889,"date":"2014-09-08T12:05:34","date_gmt":"2014-09-08T06:35:34","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=889"},"modified":"2021-08-25T11:09:27","modified_gmt":"2021-08-25T11:09:27","slug":"add-custom-view-in-lookup-and-disable-all-the-other-views","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/","title":{"rendered":"Add Custom View in Lookup and Disable all the other Views"},"content":{"rendered":"<p style=\"text-align: justify;\">We had a requirement in which we were supposed to use a <strong>addCustomView<\/strong> method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a user wants, he\/she could choose the different view from the Lookup window dialog and select the other records too, which the users were not supposed to choose.<\/p>\n<p style=\"text-align: justify;\">Let us first introduce you to the situation, on the Quote form we have a Lookup field called <strong>Project Template<\/strong>. And, on the Quote Product form we have another Lookup field called <strong>Project Template Items<\/strong> which should be filtered as per the value chosen for the <strong>Project Template<\/strong>.<\/p>\n<p style=\"text-align: justify;\">We`ll start from the point where we have the <strong>ID <\/strong>of the chosen <strong>Project Template<\/strong>(to get the ID, you need to write a script on the Load of the Quote Product form).<\/p>\n<p style=\"text-align: justify;\">Initially, what we started off was adding our custom view, but it still allowed the user to switch between different views, as a result users were able to choose records from other views.<\/p>\n<p style=\"text-align: justify;\">We`ll explain you both the situations, the <strong>Initial Situation<\/strong>(which was adding the custom view) and the <strong>Ideal Situation<\/strong>(which was adding the custom view and restricting users from selecting other view) .<\/p>\n<p style=\"text-align: justify;\">First and foremost, for the Lookup that`ll have filtered values, you need to change the below properties. These are the necessary steps.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 1: <\/strong><\/p>\n<p style=\"text-align: justify;\">From the form editor, go to the properties of the Lookup field.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 2:<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-890\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg\" alt=\"1\" width=\"447\" height=\"170\" \/><\/a><\/p>\n<p>In the<strong> Additional Properties <\/strong>section,<\/p>\n<p>Default View &#8211; Select a View.<\/p>\n<p>View Selector &#8211; Choose &#8220;<strong>Show Selected Views<\/strong>&#8220;.<\/p>\n<p>System Views\u00a0 &#8211; Only Select the view which was selected in the Default view.<\/p>\n<p><strong>Initial Situation<\/strong><strong>:<\/strong><\/p>\n<p>In this situation, we were doing everything right but, we missed something that stopped us from getting the ideal output.<\/p>\n<p><strong>Code<\/strong><\/p>\n<p>function setCustomView(projectTemplateId) {<\/p>\n<p>var functionName = &#8220;setCustomView&#8221;;<\/p>\n<p>try {<\/p>\n<p>\/\/Check whether the field exist or not<\/p>\n<p style=\"text-align: justify;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (isValid(Xrm.Page.getControl(&#8220;new_projecttemplateitemid&#8221;))) {<\/p>\n<div style=\"border: 2px solid; padding: 10px 40px; background: #ffffff; width: 400px; border-radius: 0px;\">\n<p>\/\/ add the randomly generated GUID for the view id<br \/>\nvar viewId = &#8216;{00000000-0000-0000-0000-000000000001}&#8217;;<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\/\/add the entity name<\/p>\n<p>var entityName = &#8220;new_projecttemplateitem&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/ add the view display name<\/p>\n<p>var viewDisplayName = &#8220;Project Template Item Lookup View&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/ fetch xml for filtered Project Template Item records<\/p>\n<p>var fetchXml = &#8220;&lt;fetch version=&#8217;1.0&#8242; output-format=&#8217;xml-platform&#8217; mapping=&#8217;logical&#8217; distinct=&#8217;false&#8217;&gt; &#8221; +<\/p>\n<p>&#8220;&lt;entity name=&#8217;new_projecttemplateitem&#8217;&gt;&#8221; +<\/p>\n<p>&#8220;&lt;attribute name=&#8217;new_name&#8217; \/&gt;&#8221; +<\/p>\n<p>&#8220;&lt;filter type=&#8217;and&#8217;&gt;&#8221; +<\/p>\n<p>&#8220;&lt;condition attribute=&#8217;new_projecttemplate&#8217; operator=&#8217;eq&#8217; value='&#8221; + projectTemplateId + &#8220;&#8216; \/&gt;&#8221; +<\/p>\n<p>&#8220;&lt;\/filter&gt;&#8221; +<\/p>\n<p>&#8220;&lt;\/entity&gt;&#8221; +<\/p>\n<p>&#8220;&lt;\/fetch&gt;&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/Grid Layout for filtered records<\/p>\n<p>var layoutXml = &#8220;&lt;grid name=&#8217;resultset&#8217; object=&#8217;1&#8242; jump=&#8217;productid&#8217; select=&#8217;1&#8242; icon=&#8217;1&#8242; preview=&#8217;1&#8242;&gt;&#8221; +<\/p>\n<p>&#8220;&lt;row name=&#8217;result&#8217; id=&#8217;new_projecttemplateitemid&#8217;&gt;&#8221; +<\/p>\n<p>&#8220;&lt;cell name=&#8217;new_name&#8217; width=&#8217;150&#8242; \/&gt;&#8221; +<\/p>\n<p>&#8220;&lt;cell name=&#8217;createdon&#8217; width=&#8217;150&#8242; \/&gt;&#8221; +<\/p>\n<p>&#8220;&lt;\/row&gt;&#8221; +<\/p>\n<p>&#8220;&lt;\/grid&gt;&#8221;;<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/ add the custom view for the lookup field<\/p>\n<p>Xrm.Page.getControl(&#8220;new_projecttemplateitemid&#8221;).addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);<\/p>\n<p>}<\/p>\n<p>} catch (e) {<\/p>\n<p>throwError(e, functionName);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>In the above code everything was right but,<\/p>\n<p style=\"text-align: justify;\">on selecting the Custom view, we were getting the below results:<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/2.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-892\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/2.jpg\" alt=\"2\" width=\"402\" height=\"304\" \/><\/a><\/p>\n<p>And, on selecting the System View, we were getting the below results.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/3.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-893\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/3.jpg\" alt=\"3\" width=\"396\" height=\"365\" \/><\/a><\/p>\n<p>Both the views were giving us different results, which we never wanted.<\/p>\n<p>&nbsp;<\/p>\n<p>So, in the search of an ideal situation we found the below solution.<\/p>\n<p><strong>Ideal Situation<\/strong><strong>:<\/strong><\/p>\n<p>Replace the code in the box with the below code.<\/p>\n<p><strong>Code<\/strong><\/p>\n<p>\/\/ add the default View GUID for the view id<\/p>\n<p>var viewId = Xrm.Page.getControl(&#8220;new_projecttemplateitemid&#8221;).getDefaultView();<\/p>\n<p>This single piece of line works like a charm.<\/p>\n<p>Now, we got the below results on selecting both the views.<\/p>\n<p><strong>Custom View<\/strong>:<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/4.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-894\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/4.jpg\" alt=\"4\" width=\"308\" height=\"230\" \/><\/a><\/p>\n<p><strong>System View:<\/strong><\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/5.jpg\"><img decoding=\"async\" class=\"alignnone size-full wp-image-895\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/5.jpg\" alt=\"5\" width=\"318\" height=\"249\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>And, this is how we got the desirable result with a small tweak in the code.<\/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\">Free 70% of storage space in CRM with Attachment Management Apps!<\/div><\/div><\/h2>\n<p><em><strong><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/attach-2-dynamics-365-crm-upload-multiple-files-sharepoint-cloud-storage\" target=\"_blank\" rel=\"noopener noreferrer\">Attach2Dynamics<\/a> &#8211; Store and manage documents\/attachments in cloud storage of your choice &#8211; SharePoint, Dropbox or Azure Blob Storage from within Dynamics 365 CRM.<\/em><br \/>\n<em><strong><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/dynamics-365-crm-sharepoint-security-metadata-sync\" target=\"_blank\" rel=\"noopener noreferrer\">SharePoint Security Sync<\/a><\/strong> \u2013 Robust and secure solution to integrate Dynamics 365 CRM and SharePoint Security Sync thereby ensuring secure access to confidential documents stored in SharePoint.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/\">Read More: Add Custom View in Lookup and Disable all the other\u2026 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,21,22,24],"tags":[456,1012,1790],"class_list":["post-889","post","type-post","status-publish","format-standard","hentry","category-dynamics-crm","category-dynamics-crm-2013","category-dynamics-crm-2015","category-dynamics-crm-2016","tag-custom-view","tag-lookup","tag-views"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Inogic\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2014-09-08T06:35:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-08-25T11:09:27+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inogicindia\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Inogic\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#blogposting\",\"name\":\"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Add Custom View in Lookup and Disable all the other Views\",\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/1.jpg\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#articleImage\"},\"datePublished\":\"2014-09-08T12:05:34+05:30\",\"dateModified\":\"2021-08-25T11:09:27+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#webpage\"},\"articleSection\":\"Dynamics CRM, Dynamics CRM 2013, Dynamics CRM 2015, Dynamics CRM 2016, Custom View, lookup, Views\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"name\":\"Dynamics CRM\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"position\":2,\"name\":\"Dynamics CRM\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2013\\\/#listItem\",\"name\":\"Dynamics CRM 2013\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2013\\\/#listItem\",\"position\":3,\"name\":\"Dynamics CRM 2013\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2013\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#listItem\",\"name\":\"Add Custom View in Lookup and Disable all the other Views\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/#listItem\",\"name\":\"Dynamics CRM\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#listItem\",\"position\":4,\"name\":\"Add Custom View in Lookup and Disable all the other Views\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-crm\\\/dynamics-crm-2013\\\/#listItem\",\"name\":\"Dynamics CRM 2013\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"By Inogic\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inogicindia\",\"https:\\\/\\\/twitter.com\\\/inogic\",\"https:\\\/\\\/www.instagram.com\\\/inogicindia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCM4V7ousgLSu1hbOEv4DUuQ\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inogicindia\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/\",\"name\":\"Inogic\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Inogic\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/\",\"name\":\"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2014\\\/09\\\/add-custom-view-in-lookup-and-disable-all-the-other-views\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2014-09-08T12:05:34+05:30\",\"dateModified\":\"2021-08-25T11:09:27+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"alternateName\":\"Inogic\",\"description\":\"By Inogic\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks","description":"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a","canonical_url":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#blogposting","name":"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Add Custom View in Lookup and Disable all the other Views","author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#articleImage"},"datePublished":"2014-09-08T12:05:34+05:30","dateModified":"2021-08-25T11:09:27+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#webpage"},"articleSection":"Dynamics CRM, Dynamics CRM 2013, Dynamics CRM 2015, Dynamics CRM 2016, Custom View, lookup, Views"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.inogic.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","name":"Dynamics CRM"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","position":2,"name":"Dynamics CRM","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/#listItem","name":"Dynamics CRM 2013"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/#listItem","position":3,"name":"Dynamics CRM 2013","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#listItem","name":"Add Custom View in Lookup and Disable all the other Views"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/#listItem","name":"Dynamics CRM"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#listItem","position":4,"name":"Add Custom View in Lookup and Disable all the other Views","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/#listItem","name":"Dynamics CRM 2013"}}]},{"@type":"Organization","@id":"https:\/\/www.inogic.com\/blog\/#organization","name":"Microsoft Dynamics 365 CRM Tips and Tricks","description":"By Inogic","url":"https:\/\/www.inogic.com\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/inogicindia","https:\/\/twitter.com\/inogic","https:\/\/www.instagram.com\/inogicindia\/","https:\/\/www.youtube.com\/channel\/UCM4V7ousgLSu1hbOEv4DUuQ","https:\/\/www.linkedin.com\/company\/inogicindia"]},{"@type":"Person","@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author","url":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/","name":"Inogic","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Inogic"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/","name":"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks","description":"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2014-09-08T12:05:34+05:30","dateModified":"2021-08-25T11:09:27+05:30"},{"@type":"WebSite","@id":"https:\/\/www.inogic.com\/blog\/#website","url":"https:\/\/www.inogic.com\/blog\/","name":"Microsoft Dynamics 365 CRM Tips and Tricks","alternateName":"Inogic","description":"By Inogic","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic","og:type":"article","og:title":"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a","og:url":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg","article:published_time":"2014-09-08T06:35:34+00:00","article:modified_time":"2021-08-25T11:09:27+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Add Custom View in Lookup and Disable all the other Views - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"We had a requirement in which we were supposed to use a addCustomView method in order to filter the Lookup. We came across a situation in which we were able to set the custom view(The view with filtered records) as a default view to restrict the users from choosing the other records, but if a","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2014\/09\/1.jpg","twitter:label1":"Written by","twitter:data1":"Inogic","twitter:label2":"Est. reading time","twitter:data2":"4 minutes"},"aioseo_meta_data":{"post_id":"889","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-02 06:08:56","updated":"2025-07-03 23:04:10","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/\" title=\"Dynamics CRM\">Dynamics CRM<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/\" title=\"Dynamics CRM 2013\">Dynamics CRM 2013<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAdd Custom View in Lookup and Disable all the other Views\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics CRM","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/"},{"label":"Dynamics CRM 2013","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-crm\/dynamics-crm-2013\/"},{"label":"Add Custom View in Lookup and Disable all the other Views","link":"https:\/\/www.inogic.com\/blog\/2014\/09\/add-custom-view-in-lookup-and-disable-all-the-other-views\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/889","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=889"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/889\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}