{"id":21688,"date":"2021-01-29T10:00:30","date_gmt":"2021-01-29T10:00:30","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=21688"},"modified":"2021-01-29T10:00:33","modified_gmt":"2021-01-29T10:00:33","slug":"pan-no-field-validation-in-sage-x3","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2021\/01\/29\/pan-no-field-validation-in-sage-x3\/","title":{"rendered":"PAN No Field Validation in Sage X3"},"content":{"rendered":"\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\" target=\"_blank\">Sage X3<\/a> has Supplier master where we can define information about supplier, where we have added PAN number field which will store PAN number of supplier. So for that field one of our client requested us to add validation for PAN number which can accept only string in PAN format i.e. length of the string should be 10 digit only first 5 characters should be alphabets, next 4 should be numbers and last one should be alphabet.<\/p>\n\n\n\n<p>So to achieve this requirement programmatically we have added some code on \u201cAfter Change(AM_XXX)\u201d action on PAN number field:<\/p>\n\n\n\n<p><strong>New Stuff:<\/strong> <a rel=\"noreferrer noopener\" href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2021\/01\/27\/how-to-display-reserved-quantity-message-in-sales-order-screen-in-sage-x3\/\" data-type=\"URL\" data-id=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2021\/01\/27\/how-to-display-reserved-quantity-message-in-sales-order-screen-in-sage-x3\/\" target=\"_blank\">How to display reserved quantity message in Sales Order screen in Sage X3<\/a><\/p>\n\n\n\n<h6 class=\"wp-block-heading\">#################################################################################<\/h6>\n\n\n\n<p>SUBPROG PANValidation(PANNO)<br>VALUE CHAR PANNO<\/p>\n\n\n\n<p>Local integer I : I = 0<\/p>\n\n\n\n<p>Local integer k : k = 0<\/p>\n\n\n\n<p>LOCAL CHAR TEMP(10) : TEMP = PANNO<\/p>\n\n\n\n<p>Local CHAR CH1(5)<\/p>\n\n\n\n<p>Local CHAR CH2(4)<\/p>\n\n\n\n<p>Local CHAR CH3(1)<\/p>\n\n\n\n<p>IF LEN(TEMP) = 10<\/p>\n\n\n\n<p>      CH1 = NUM$(LEFT$(TEMP,5))<\/p>\n\n\n\n<p>      CH2 = NUM$(SEG$(TEMP,6,9))<\/p>\n\n\n\n<p>      CH3 = NUM$(SEG$(TEMP,10,10))<\/p>\n\n\n\n<p>I = 0<\/p>\n\n\n\n<p>k = 0<br>for I = 1 to len(CH1)<br>k = find (seg$(CH1,I,I), &#8220;A&#8221;,&#8221;B&#8221;,&#8221;C&#8221;,&#8221;D&#8221;,&#8221;E&#8221;,&#8221;F&#8221;,&#8221;G&#8221;,&#8221;H&#8221;,&#8221;I&#8221;,&#8221;J&#8221;,&#8221;K&#8221;,&#8221;L&#8221;,&#8221;M&#8221;,&#8221;N&#8221;,&#8221;O&#8221;,&#8221;P&#8221;,&#8221;Q&#8221;,&#8221;R&#8221;,&#8221;S&#8221;,&#8221;T&#8221;,&#8221;U&#8221;,&#8221;V&#8221;,&#8221;W&#8221;,&#8221;X&#8221;,&#8221;Y&#8221;,&#8221;Z&#8221;)<br>      IF k = 0<\/p>\n\n\n\n<p>           INFBOX &#8220;INVALID PAN NUMBER&#8221;<\/p>\n\n\n\n<p>           mkstat=2<\/p>\n\n\n\n<p>      end<\/p>\n\n\n\n<p>ENDIF<\/p>\n\n\n\n<p>NEXT<\/p>\n\n\n\n<p>I = 0<\/p>\n\n\n\n<p>k = 0<br>for I = 1 to len(CH2)<br>k = find (seg$(CH2,I,I), &#8220;0&#8221;,&#8221;1&#8243;,&#8221;2&#8243;,&#8221;3&#8243;,&#8221;4&#8243;,&#8221;5&#8243;,&#8221;6&#8243;,&#8221;7&#8243;,&#8221;8&#8243;,&#8221;9&#8243;)<br>      IF k = 0<br>           INFBOX &#8220;INVALID PAN NUMBER&#8221;<\/p>\n\n\n\n<p>            mkstat=2<br>       end<br>ENDIF<\/p>\n\n\n\n<p>NEXT<\/p>\n\n\n\n<p>I = 0<\/p>\n\n\n\n<p>k = 0<br>for I = 1 to len(CH3)<\/p>\n\n\n\n<p>k = find (seg$(CH3,I,I), &#8220;A&#8221;,&#8221;B&#8221;,&#8221;C&#8221;,&#8221;D&#8221;,&#8221;E&#8221;,&#8221;F&#8221;,&#8221;G&#8221;,&#8221;H&#8221;,&#8221;I&#8221;,&#8221;J&#8221;,&#8221;K&#8221;,&#8221;L&#8221;,&#8221;M&#8221;,&#8221;N&#8221;,&#8221;O&#8221;,&#8221;P&#8221;,&#8221;Q&#8221;,&#8221;R&#8221;,&#8221;S&#8221;,&#8221;T&#8221;,&#8221;U&#8221;,&#8221;V&#8221;,&#8221;W&#8221;,&#8221;X&#8221;,&#8221;Y&#8221;,&#8221;Z&#8221;)<br>      IF k = 0<br>           INFBOX &#8220;INVALID PAN NUMBER&#8221;<br>           mkstat=2<br>      end<br>ENDIF<\/p>\n\n\n\n<p>NEXT<\/p>\n\n\n\n<p>ELSE<br>      IF LEN(TEMP) &lt;> 0<br>           INFBOX &#8220;INVALID PAN NUMBER&#8221;<br>           mkstat=2<br>ENDIF<br>ENDIF<br>END<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">#################################################################################<\/h6>\n\n\n\n<p>In above script we have created one subprogram named as \u201cPANValidation\u201d which is called in \u2018after change\u2019 action of PAN number field and has parameter as PAN number. In subprogram firstly we have stored PAN number in TEMP variable and then segregated TEMP to 3 different variables. After this we have validated every character of every variable with alphabet &amp; number as shown in above script.<\/p>\n\n\n\n<p>According to above script if any character of string is not following the condition mentioned in script then it will popup message of \u201cINVALID PAN NUMBER\u201d and not allow to proceed further up to user is not entering valid format.<\/p>\n\n\n\n<p>In this way, we can do PAN number validation on particular field for a specific format of a string in Sage X3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><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>Sage X3 has Supplier master where we can define information about supplier, where we have added PAN number field which will store PAN number of supplier. So for that field one of our client requested us to add validation for PAN number which can accept only string in PAN format i.e. length of the string\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2021\/01\/29\/pan-no-field-validation-in-sage-x3\/\">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],"tags":[20,48,3213,3190,2977,2357,2371],"class_list":["post-21688","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","tag-4gl","tag-action","tag-format-2","tag-pan-no","tag-script","tag-validation","tag-variables"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21688","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=21688"}],"version-history":[{"count":6,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21688\/revisions"}],"predecessor-version":[{"id":21694,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/21688\/revisions\/21694"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=21688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=21688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=21688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}