{"id":26078,"date":"2020-12-21T13:02:46","date_gmt":"2020-12-21T13:02:46","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=26078"},"modified":"2020-12-22T08:25:38","modified_gmt":"2020-12-22T08:25:38","slug":"get-subgrid-information-from-the-pcf-context","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/12\/get-subgrid-information-from-the-pcf-context\/","title":{"rendered":"Get Subgrid Information from the PCF Context"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p style=\"text-align: justify;\">Recently we were working on a PCF dataset control that can be configured on the Home grid as well as on the subgrid. So while developing the control there were few queries such as what data can we get from the context object regarding the Subgrid. For example, the Subgird label, View ID, Relationship Name for which the Subgird is configured, whether the auto-expand property is true or not, etc.<\/p>\n<p>For finding out I used my developer tool and then used it to check the information that we get in the context for the dataset.<\/p>\n<p style=\"text-align: justify;\">In <strong>\u2018context.navigation._customControlProperties\u2019<\/strong> we get all the information regarding the Subgird as shown in the below screenshot.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26080 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1.png\" alt=\"Get Subgrid Information from the PCF Context\" width=\"1201\" height=\"636\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1.png 1201w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1-300x159.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1-768x407.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1-1024x542.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-1-660x350.png 660w\" sizes=\"(max-width: 1201px) 100vw, 1201px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">In <strong>\u2018context.navigation._customControlProperties.descriptor\u2019<\/strong> you will get to know some useful information which you can use for control like<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26081 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2.png\" alt=\"Get Subgrid Information from the PCF Context\" width=\"848\" height=\"288\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2.png 848w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2-300x102.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2-768x261.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-2-660x224.png 660w\" sizes=\"(max-width: 848px) 100vw, 848px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Apart from the above-mentioned information, you can get many more details like whether the auto-expand is enabled which can be used for control styling, etc.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26079 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3.png\" alt=\"Get Subgrid Information from the PCF Context\" width=\"876\" height=\"650\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3.png 876w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3-300x223.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3-768x570.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Get-Subgrid-Information-from-the-PCF-Context-3-660x490.png 660w\" sizes=\"(max-width: 876px) 100vw, 876px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">You can know whether the control is configured on the Home grid or subgrid by following this <a href=\"https:\/\/www.inogic.com\/blog\/2019\/08\/how-to-detect-dataset-pcf-control-is-set-for-home-grid-or-sub-grid\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a>.<\/p>\n<h2>Conclusion<\/h2>\n<p style=\"text-align: justify;\">Thus, as explained above, we can get additional information regarding the subgrid using the context object provided by the PCF control.<\/p>\n<p><a href=\"https:\/\/maplytics.com\/blog\/new-advanced-auto-scheduling-feature-within-dynamics-365-crm-for-flexible-field-service-scheduling-and-planning\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26103 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Appointment-Planner.jpg\" alt=\"\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Appointment-Planner.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Appointment-Planner-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Appointment-Planner-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/12\/Appointment-Planner-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Recently we were working on a PCF dataset control that can be configured on the Home grid as well as on the subgrid. So while developing the control there were few queries such as what data can we get from the context object regarding the Subgrid. For example, the Subgird label, View ID, Relationship\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/12\/get-subgrid-information-from-the-pcf-context\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"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":[16,18,19,24,1929],"tags":[545,592,1033,1941],"class_list":["post-26078","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-dynamics-crm-2016","category-pcf","tag-dynamics-365-crm","tag-dynamics-crm","tag-map-dynamics-crm","tag-pcf-control"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26078","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=26078"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26078\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=26078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=26078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=26078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}