{"id":29345,"date":"2021-09-15T16:20:10","date_gmt":"2021-09-15T10:50:10","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=29345"},"modified":"2021-10-07T11:20:53","modified_gmt":"2021-10-07T05:50:53","slug":"programmatically-know-the-time-control-status-using-the-getstate-method","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/","title":{"rendered":"Programmatically know the Time control Status using the GetState method"},"content":{"rendered":"<h2 style=\"text-align: justify;\"><strong>Introduction<\/strong><\/h2>\n<p style=\"text-align: justify;\">Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date.<\/p>\n<p style=\"text-align: justify;\">E.g. Whether a Lead has been qualified before the estimated close date etc.<\/p>\n<p style=\"text-align: justify;\">In this blog, we will see how we can programmatically get the status of the Time Control using form scripting.<\/p>\n<p style=\"text-align: justify;\">To know more about Time control and how to configure it, please follow this <a href=\"https:\/\/www.inogic.com\/blog\/2014\/06\/adding-timer-control-to-lead-entity-in-dynamics-crm-2013-spring-release\/\" target=\"_blank\" rel=\"noopener\">link<\/a>.<\/p>\n<p style=\"text-align: justify;\">In this example, I have configured the Time Control for Case Entity and on the load of the Form it will check the status of the Timer Control and show the Status as a Form Notification.<\/p>\n<p style=\"text-align: justify;\">If the case is resolved before the <strong>Resolve By<\/strong> period then it is considered under <strong>Success<\/strong> and similarly, if the case is in the <strong>Cancelled<\/strong> stage then it is considered as <strong>Failure<\/strong>.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-29348 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png\" alt=\"GetState method\" width=\"868\" height=\"677\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png 868w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1-300x234.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1-768x599.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1-660x515.png 660w\" sizes=\"(max-width: 868px) 100vw, 868px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Syntax: formContext.getControl(\u201c&lt;Your Timer Control Name&gt;\u201d).getState()<\/strong>;<\/p>\n<p style=\"text-align: justify;\">The name property of the Timer Control would be the logical name.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method2.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-29347 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method2.png\" alt=\"GetState method\" width=\"607\" height=\"558\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method2.png 607w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method2-300x276.png 300w\" sizes=\"(max-width: 607px) 100vw, 607px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Code: <\/strong><\/p>\n<p style=\"text-align: justify;\">To check and show the Timer Control as Form Notification, I have registered a script on Load of the form.<\/p>\n<pre class=\"lang:css gutter:true start:1\">\/\/Register the function on the Form on Load event\r\nonLoad\u00a0=\u00a0(executionContext)\u00a0=&gt;\u00a0{\r\nlet\u00a0functionName:\u00a0string\u00a0=\u00a0\"onLoad\";\r\nlet\u00a0timeControlStatus:\u00a0number\u00a0=\u00a00;\r\ntry\u00a0{\r\n\/\/checking\u00a0execution\u00a0context\u00a0\r\nif\u00a0(executionContext\u00a0==\u00a0null)\u00a0{\r\nreturn;\r\n}\r\n\/\/getting\u00a0form\u00a0context\r\nlet\u00a0formContext\u00a0=\u00a0executionContext.getFormContext();\r\ntimeControlStatus\u00a0=\u00a0formContext.getControl(\"CaseResolution\").getState();\r\nthis.createFormNotificationBasedOnTimerStatus(timeControlStatus,\u00a0formContext)\r\n}\u00a0catch\u00a0(error)\u00a0{\r\nconsole.log(functionName\u00a0+\u00a0''\u00a0+\u00a0error);\r\n}\r\n}\r\n\/\/\u00a0Check\u00a0the\u00a0status\u00a0of\u00a0the\u00a0timer\u00a0control\u00a0and create notification accordingly\r\ncreateFormNotificationBasedOnTimerStatus\u00a0=\u00a0(timeControlStatus:\u00a0number,\u00a0formContext:\u00a0any)\u00a0=&gt;\u00a0{\r\nlet\u00a0functionName:\u00a0string\u00a0=\u00a0\"createFormNotificationBasedOnTimerStatus\";\r\nlet\u00a0formNotificationMsg:\u00a0string\u00a0=\u00a0\"\";\r\nlet\u00a0formNotificationLevel:\u00a0string\u00a0=\u00a0\"\";\r\nlet\u00a0uniqueId:\u00a0string\u00a0=\u00a0String(timeControlStatus);\r\ntry\u00a0{\r\nswitch\u00a0(timeControlStatus)\u00a0{\r\ncase\u00a01:<\/code>\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Not\u00a0Set\r\nformNotificationMsg\u00a0=\u00a0\"Time\u00a0Value\u00a0:\u00a0Not\u00a0Set\";\r\nformNotificationLevel\u00a0=\u00a0\"INFO\";\r\nbreak;\r\ncase\u00a02:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0In\u00a0progress\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Is\u00a0In\u00a0Progress\";<\r\nformNotificationLevel\u00a0=\u00a0\"INFO\";\r\nbreak;\r\ncase\u00a03:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Warning\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Kindly\u00a0Resolve\u00a0the\u00a0Case\u00a0at\u00a0earliest\";\r\nformNotificationLevel\u00a0=\u00a0\"WARNING\";\r\nbreak;\r\ncase\u00a04:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Violated\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Violated\";\r\nformNotificationLevel\u00a0=\u00a0\"WARNING\";\r\nbreak;\r\ncase\u00a05:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Success\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Compelted\u00a0Successfully\";\r\nformNotificationLevel\u00a0=\u00a0\"INFO\";\r\nbreak;\r\ncase\u00a06:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Expired\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Expired\";\r\nformNotificationLevel\u00a0=\u00a0\"ERROR\";\r\nbreak;\r\ncase\u00a07:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Canceled\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Canceled\";\r\nformNotificationLevel\u00a0=\u00a0\"ERROR\";\r\nbreak;\r\ncase\u00a08:\r\n\/\/\u00a0Time\u00a0Value\u00a0:\u00a0Paused\r\nformNotificationMsg\u00a0=\u00a0\"Case\u00a0Resolution:\u00a0Paused\";\r\nformNotificationLevel\u00a0=\u00a0\"INFO\";\r\nbreak;\r\ndefault:\r\nbreak;\r\n}\r\nformContext.ui.setFormNotification(formNotificationMsg,\u00a0formNotificationLevel,\u00a0uniqueId);\r\n} catch (error) {\r\nconsole.log(functionName\u00a0+\u00a0''\u00a0+\u00a0error);\r\n}\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\"><strong>Note:<\/strong><\/p>\n<p style=\"text-align: justify;\">As per <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/model-driven-apps\/clientapi\/reference\/controls\/getstate\" target=\"_blank\" rel=\"noopener\">Microsoft docs<\/a> the Get State method returns the values as shown in the below table:<\/p>\n<table class=\"dcf-table dcf-table-responsive dcf-table-bordered dcf-table-striped\" style=\"height: 317px;\" width=\"236\">\n<thead>\n<tr>\n<th class=\"dcf-txt-center\" style=\"text-align: center;\" scope=\"col\">Returned Value<\/th>\n<th class=\"dcf-txt-center\" style=\"text-align: center;\" scope=\"col\">Status Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">1<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Not Set<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">2<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">In progress<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">3<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Warning<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">4<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Violated<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">5<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Success<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">6<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Expired<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">7<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Canceled<\/td>\n<\/tr>\n<tr>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Returned Value\">8<\/td>\n<td class=\"dcf-txt-center\" style=\"text-align: center;\" data-label=\"Status Value\">Paused<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 style=\"text-align: justify;\"><strong>Conclusion<\/strong><\/h2>\n<p style=\"text-align: justify;\">Thus by using the Get State method we can get the status of the timer control and use it as per our requirement, as we have used it to notify the user in\u00a0our example. In the below screenshot we can see the final result i.e. when the Timer control is set to the <strong>Nearing Expiry<\/strong> status a form notification gets set accordingly.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-29346 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3.png\" alt=\"GetState method\" width=\"1167\" height=\"579\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3.png 1167w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3-300x149.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3-1024x508.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3-768x381.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method3-660x327.png 660w\" sizes=\"(max-width: 1167px) 100vw, 1167px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.maplytics.com\/\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"aligncenter wp-image-27021 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/maplytics.png\" alt=\"map dynamics 365\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/maplytics.png 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/maplytics-300x75.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/maplytics-768x192.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/03\/maplytics-660x165.png 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/\">Read More: Programmatically know the Time control Status using the GetState method &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":[16,19,2361],"tags":[2396,2395],"class_list":["post-29345","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","category-technical","tag-getstate-method","tag-time-control"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To\" \/>\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\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/\" \/>\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=\"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"868\" \/>\n\t\t<meta property=\"og:image:height\" content=\"677\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-09-15T10:50:10+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-10-07T05:50:53+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=\"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To\" \/>\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\/2021\/09\/GetState-method1.png\" \/>\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=\"2 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\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#blogposting\",\"name\":\"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"Programmatically know the Time control Status using the GetState method\",\"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\\\/2021\\\/09\\\/GetState-method1.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#articleImage\",\"width\":868,\"height\":677,\"caption\":\"GetState method\"},\"datePublished\":\"2021-09-15T16:20:10+05:30\",\"dateModified\":\"2021-10-07T11:20:53+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#webpage\"},\"articleSection\":\"Dynamics 365, Dynamics CRM, Technical, GetState method, Time control\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#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-365\\\/#listItem\",\"name\":\"Dynamics 365\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"position\":2,\"name\":\"Dynamics 365\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#listItem\",\"name\":\"Programmatically know the Time control Status using the GetState method\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#listItem\",\"position\":3,\"name\":\"Programmatically know the Time control Status using the GetState method\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/dynamics-365\\\/#listItem\",\"name\":\"Dynamics 365\"}}]},{\"@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\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#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\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#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\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/\",\"name\":\"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/09\\\/programmatically-know-the-time-control-status-using-the-getstate-method\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2021-09-15T16:20:10+05:30\",\"dateModified\":\"2021-10-07T11:20:53+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":"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To","canonical_url":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#blogposting","name":"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"Programmatically know the Time control Status using the GetState method","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\/2021\/09\/GetState-method1.png","@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#articleImage","width":868,"height":677,"caption":"GetState method"},"datePublished":"2021-09-15T16:20:10+05:30","dateModified":"2021-10-07T11:20:53+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#webpage"},"articleSection":"Dynamics 365, Dynamics CRM, Technical, GetState method, Time control"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#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-365\/#listItem","name":"Dynamics 365"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","position":2,"name":"Dynamics 365","item":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#listItem","name":"Programmatically know the Time control Status using the GetState method"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#listItem","position":3,"name":"Programmatically know the Time control Status using the GetState method","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/#listItem","name":"Dynamics 365"}}]},{"@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\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#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\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#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\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/","name":"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2021-09-15T16:20:10+05:30","dateModified":"2021-10-07T11:20:53+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":"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To","og:url":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png","og:image:width":868,"og:image:height":677,"article:published_time":"2021-09-15T10:50:10+00:00","article:modified_time":"2021-10-07T05:50:53+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"Programmatically know the Time control Status using the GetState method - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Introduction Often we use Dynamic 365 Time Control when we want to keep track of time based on a certain date. E.g. Whether a Lead has been qualified before the estimated close date etc. In this blog, we will see how we can programmatically get the status of the Time Control using form scripting. To","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/09\/GetState-method1.png","twitter:label1":"Written by","twitter:data1":"Inogic","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"29345","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 07:54:01","updated":"2025-07-04 08:59:21","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-365\/\" title=\"Dynamics 365\">Dynamics 365<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tProgrammatically know the Time control Status using the GetState method\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Dynamics 365","link":"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/"},{"label":"Programmatically know the Time control Status using the GetState method","link":"https:\/\/www.inogic.com\/blog\/2021\/09\/programmatically-know-the-time-control-status-using-the-getstate-method\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/29345","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=29345"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/29345\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=29345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=29345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=29345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}