{"id":24755,"date":"2022-02-28T09:40:30","date_gmt":"2022-02-28T09:40:30","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=24755"},"modified":"2022-02-28T09:40:34","modified_gmt":"2022-02-28T09:40:34","slug":"how-to-set-dynamic-status-field-on-screen-based-on-date-range","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2022\/02\/28\/how-to-set-dynamic-status-field-on-screen-based-on-date-range\/","title":{"rendered":"How to set dynamic Status field on screen based on date range"},"content":{"rendered":"\n<p>In <a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" rel=\"noreferrer noopener\">Sage X3<\/a>, one of the client\u2019s requirement was to have a dynamic \u201cPolicy Status\u201d field which will reflect the current status where the policy is Active or De-active for the selected module. Here another condition was that at a given time span only one policy per module can be kept Active, rest will stay deactivated and will get activated automatically once the date condition is satisfied.<\/p>\n\n\n\n<p>First to navigate to the screens that\u2019ll be used for the below steps:<\/p>\n\n\n\n<p>Window management: All -&gt; Development -&gt; Script dictionary -&gt; Window management<br>Script editor: All -&gt; Development -&gt; Script dictionary -&gt; Scripts -&gt; Script editor<br>Tables: All -&gt; Development -&gt; Data and parameters -&gt; Tables<\/p>\n\n\n\n<p>To fulfill the above mentioned requirement we need to follow the below steps:<\/p>\n\n\n\n<p>Step 1: Below are the locations showing the \u201cStatus and Applicable module\u201d fields on screen, on window management and on the linked table of the screen. Refer the screenshots for reference:<\/p>\n\n\n\n<p><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2022\/02\/28\/validation-on-the-sales-order-screen-if-credit-limit-exceeds\/\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2022\/02\/28\/validation-on-the-sales-order-screen-if-credit-limit-exceeds\/\" rel=\"noreferrer noopener\">Validation on the Sales order screen if credit limit exceeds<\/a><\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Module-and-Status-fields-on-screen.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Module-and-Status-fields-on-screen.png\" alt=\"Module and Status fields on screen\"><\/a><\/center>\n<font size=\"2\"><center>Module and Status fields on screen<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Status-field-under-Header-tab-in-Window-management-1024x459.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Status-field-under-Header-tab-in-Window-management-1024x459.png\" alt=\"Status field under Header tab in Window management\"><\/a><\/center>\n<font size=\"2\"><center>Status field under Header tab in Window management<\/center><\/font>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Status-field-in-linked-table-of-Header-screen-1024x298.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Status-field-in-linked-table-of-Header-screen-1024x298.png\" alt=\"Status field in linked table of Header screen\"><\/a><\/center>\n<font size=\"2\"><center>Status field in linked table of Header screen<\/center><\/font>\n\n\n\n<p>Step 2: For this customization we need to add some action events. The script code for the screen can be identified from Window management &gt; Header screen &gt; Specific script.<\/p>\n\n\n\n<p>The logic for them will be as follows:<br>Once the user clicks the \u201cNew\u201d button on screen to create a new policy and selects the Applicable Module our logic part will trigger that will check whether there is any existing Policy already for the given Module and if it does then whether it\u2019s currently Active or Inactive.<br>In case the Policy exists and is Active, the Status field is made non-editable using the DISZO command followed by AFFZO command and set to DEACTIVE. Whereas if the Policy exists but is in Inactive status, then it\u2019ll allow the user to select the status as per choice.<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Case-of-Active-existing-Policy-on-module.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px; align: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2022\/02\/Case-of-Active-existing-Policy-on-module.png\" alt=\"Case of Active existing Policy on module\"><\/a><\/center>\n<font size=\"2\"><center>Case of Active existing Policy on module<\/center><\/font>\n\n\n\n<p>Step 3: Now when a new policy is created for a given date range, then another logic is added on the LIENS action event in script which gets triggered whenever the Entry no. is browsed from left list selection or opening the screen.<\/p>\n\n\n\n<p>This logic checks if the current date is within the Policy date range first and then:<br>If the current date is within the date range then it\u2019ll check if the status is Active or De-active.<br>For the Active case the logic will return from the event without any change.<br>For the De-active case the logic will check if there is any existing Active policy for the module, if not then it\u2019ll change the status to ACTIVE on the screen and trigger an Update instruction on the table.<\/p>\n\n\n\n<p>If the current date exceeds the To date of Policy:<br>For the Active case the logic will change the status to DEACTIVE and make the field non-editable using the DISZO command followed by AFFZO command, and update the table using the Update instruction.<br>For the De-active case logic will return from the event without any change.<\/p>\n\n\n\n<p>This way we can dynamically set the status field on screen based on the policy date range.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-c5e1638fe0db781fd132d689b469078c\" style=\"color:#c71d22\"><strong>About Us<\/strong><\/h2>\n\n\n\n<p>Greytrix \u2013 a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.<\/p>\n\n\n\n<p id=\"block-28013e99-0882-44c6-b705-7b16c85053b2\">Greytrix&nbsp;has some unique integration solutions developed for&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-crm\/\">Sage CRM<\/a>&nbsp;with Sage ERPs&nbsp;namely&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-x3-erp\/\">Sage X3<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-intacct\/\">Sage Intacct<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-100-erp\/\">Sage 100<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-500-erp\/\">Sage 500<\/a>,&nbsp;and&nbsp;<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">Sage 300<\/a>. We also offer best-in-class&nbsp;Sage ERP&nbsp;and&nbsp;Sage CRM&nbsp;customization and development services&nbsp;to&nbsp;Business&nbsp;Partners,&nbsp;End&nbsp;Users, and Sage PSG worldwide. Greytrix&nbsp;helps in&nbsp;the migration of Sage CRM from&nbsp;Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes&nbsp;addons like&nbsp;&nbsp;Greytrix Business Manager,&nbsp;Sage CRM Project Manager,&nbsp;Sage CRM Resource Planner,&nbsp;Sage CRM Contract Manager,&nbsp;Sage CRM Event Manager,&nbsp;Sage CRM Budget Planner,&nbsp;Gmail Integration,&nbsp;Sage CRM Mobile Service Signature,&nbsp;Sage CRM CTI Framework.<\/p>\n\n\n\n<p id=\"block-4bc42a09-fb13-4598-8137-ce5f7b91ce28\">Greytrix is a recognized&nbsp;Sage Champion Partner&nbsp;for GUMU&#x2122; Sage X3 \u2013 Sage CRM integration listed on&nbsp;<a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Marketplace<\/a>&nbsp;and Sage CRM \u2013 Sage Intacct integration listed on&nbsp;<a href=\"https:\/\/marketplace.intacct.com\/MPListing?lid=a2D0H000007kiHyUAI\" target=\"_blank\" rel=\"noreferrer noopener\">Sage Intacct Marketplace<\/a>. The&nbsp;<a href=\"https:\/\/www.greytrix.com\/gumu\/\" target=\"_blank\" rel=\"noreferrer noopener\">GUMU&#x2122; Cloud framework<\/a>&nbsp;by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.<\/p>\n\n\n\n<p id=\"block-76376301-1c3e-4250-8a09-727595a606f0\">For more information on our integration solutions, please contact us at&nbsp;<a href=\"mailto:sage@greytrix.com\">sage@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Sage X3, one of the client\u2019s requirement was to have a dynamic \u201cPolicy Status\u201d field which will reflect the current status where the policy is Active or De-active for the selected module. Here another condition was that at a given time span only one policy per module can be kept Active, rest will stay\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2022\/02\/28\/how-to-set-dynamic-status-field-on-screen-based-on-date-range\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,13],"tags":[504,3578,3573,1098,3579,1977],"class_list":["post-24755","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","category-integration","tag-date","tag-dynamic-change","tag-insurance","tag-inventory","tag-policy","tag-sales"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/24755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=24755"}],"version-history":[{"count":11,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/24755\/revisions"}],"predecessor-version":[{"id":24771,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/24755\/revisions\/24771"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=24755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=24755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=24755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}