{"id":3094,"date":"2018-07-13T02:14:44","date_gmt":"2018-07-13T02:14:44","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3094"},"modified":"2018-07-13T02:14:44","modified_gmt":"2018-07-13T02:14:44","slug":"no-code-solution-for-filtering-subgrid-based-on-the-lookup","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3094","title":{"rendered":"No Code solution for Filtering Subgrid based on the Lookup"},"content":{"rendered":"<p>There is a common requirement to filter subgrid based on the lookup field, but there is no easy way to implement it without writing code. In this post I am going to discuss a quick workaround to implement this requirement. Let&#8217;s see how we can implement this.<\/p>\n<p><strong>Requirement<\/strong>: We want to show marketing list for accounts in contact form based on the account lookup.<\/p>\n<p><strong>Solution<\/strong>: We can implement this requirement with the help of the quick view form \ud83d\ude42 using following steps:<\/p>\n<p>1. Open default solutions by Navigating to <strong>Settings-&gt;Customizations-&gt;Customize<\/strong> the Systems or create your custom solution and add Account and Contact entity to your custom solution.<br \/>\n2. Navigate to Forms under Account entity<br \/>\n3. Create New Quick View form and change form name &#8220;<strong>AccountMarketingListQuickViewForm<\/strong>&#8221; using Form Property button on the top<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3095 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate1-300x128.png\" alt=\"quickcreate1\" width=\"300\" height=\"128\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate1-300x128.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate1.png 598w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>4. Click on Insert and add a subgrid and set following options<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3096 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate2-300x266.png\" alt=\"quickcreate2\" width=\"300\" height=\"266\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate2-300x266.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate2-624x553.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate2.png 909w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n5. Save and Publish your changes<br \/>\n6. Open Contact form and Insert a Quick View form by navigating to<strong> Insert-&gt;Quick View Form<\/strong>, we need to set following properties<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3097 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate3-300x180.png\" alt=\"quickcreate3\" width=\"300\" height=\"180\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate3-300x180.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate3.png 565w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n7. Save and Publish your changes.<\/p>\n<p>Now let&#8217;s say we have one marketing list Current Resellers having &#8220;Hewlett Packard&#8221; account<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3098 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4-300x107.png\" alt=\"quickcreate4\" width=\"300\" height=\"107\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4-300x107.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4-1024x364.png 1024w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4-624x222.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate4.png 1074w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now open contact having Hewlett Packard in company name lookup and you will be able to see related marketing list like below<\/p>\n<p><a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3099 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5-300x124.png\" alt=\"quickcreate5\" width=\"300\" height=\"124\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5-300x124.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5-1024x424.png 1024w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5-624x259.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/07\/quickcreate5.png 1086w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Hope it will help someone !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a common requirement to filter subgrid based on the lookup field, but there is no easy way to implement it without writing code. In this post I am going to discuss a quick workaround to implement this requirement. Let&#8217;s see how we can implement this. Requirement: We want to show marketing list for accounts in contact form based&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3094\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402,522,6,8,275],"tags":[547,546,548],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3094"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3094"}],"version-history":[{"count":3,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3094\/revisions"}],"predecessor-version":[{"id":3102,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3094\/revisions\/3102"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}