{"id":165,"date":"2012-02-18T10:48:16","date_gmt":"2012-02-18T10:48:16","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=165"},"modified":"2023-10-04T11:17:46","modified_gmt":"2023-10-04T11:17:46","slug":"difference-between-x3-actions-apres-modif-vs-am-xxx","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2012\/02\/18\/difference-between-x3-actions-apres-modif-vs-am-xxx\/","title":{"rendered":"Difference between Sage X3 ACTIONS &#8211; APRES_MODIF v\/s AM_XXX"},"content":{"rendered":"<p>We have come across many technical queries regarding the actions of Sage ERP X3, one of them was<br \/>\n\u201cCould anybody tell me what is the major difference between field after the change (AM_XXX) and APRES_MODIF events, and which of them better to use?\u201d<\/p>\n<p>It quite true that in X3 with so many events at our disposable, sometimes it can be difficult to choose from actions that virtually are same but are quite different. So I saw a point in writing a blog on this.<\/p>\n<p>The <strong>APRES_MODIF<\/strong> action:<br \/>\nIt is an object action that is called as and when a field is modified. We have defined the action which occurs just before the APRES_MODIF is fired.<\/p>\n<ul>\n<li>After the field <strong>AM_<\/strong> (After Change) action.<\/li>\n<li>Before the <strong>[M]<\/strong> class is updated with the new value.<\/li>\n<\/ul>\n<p>Following are the available variables with this action:<\/p>\n<p><strong>COUZON<\/strong>: Name of current field.<br \/>\n<strong>CZ<\/strong>: Current value of field.<br \/>\n<strong>COUIND<\/strong>: Current index (Array fields)<strong>.<\/strong><\/p>\n<p>The <strong>AM_XXX<\/strong> action:<br \/>\nThis action fires After Modification of the screen fields XXX on the screen, but to trace this action user need to define the action type against the respective field.<\/p>\n<p>The Action type selected is \u2018After Change\u2019 the Screen Dictionary. This action comes with a default parameter \u2018VALUER\u2019. The VALUER contains current field value whereas [M] XXX contains the value before the field was modified.<\/p>\n<p><strong>Difference between the 2 actions:<\/strong><br \/>\n<strong>APRES_MODIF:<br \/>\n<\/strong>APRES_MODIF is an object action. Object actions are global events that are executed when users maintain or navigate through records in an object. Object Actions are triggered any time a user accesses an object, navigates through records, any event triggered using the action buttons, refreshes the screen, changes the left browser, creates, modifies or deletes an object etc.<br \/>\n<strong><span style=\"text-decoration: underline;\">Code View<\/span><\/strong><strong>:<\/strong><br \/>\n<em>####################################################################################<\/em><br \/>\n<em>$ACTION<br \/>\nCase ACTION<br \/>\nWhen &nbsp;&nbsp;\u2018APRES_MODIF\u2019&nbsp; &nbsp;:&nbsp;&nbsp; Gosub&nbsp;&nbsp; APRES_MODIF<br \/>\nWhen&nbsp; &nbsp;Default<br \/>\nEndcase<br \/>\nRETURN<\/em><br \/>\n<em>####################################################################################<\/em><br \/>\n<em>####################################################################################<\/em><br \/>\n<em>$APRES_MODIF<\/em><br \/>\n<em>For I=0 To 2<br \/>\nIf evalue(&#8220;dim([M:ZPH&#8221;+num$(I)+&#8221;]DACDIA)&gt;0 &amp; [M:ZPH&#8221;+num$(I)+&#8221;]DACDIA&lt;&gt;'&#8221;+[F:ZPH]DACDIA+&#8221;&#8216;&#8221;)<br \/>\nCase I<br \/>\nWhen 0 : [M:ZPH0]DACDIA=[F:ZPH]DACDIA : Affzo [ZPH0]DACDIA<br \/>\nWhen 1 : [M:ZPH1]DACDIA=[F:ZPH]DACDIA : Affzo [ZPH1]DACDIA<br \/>\nWhen 2 : [M:ZPH2]DACDIA=[F:ZPH]DACDIA : Affzo [ZPH2]DACDIA<br \/>\nEndcase<br \/>\nBreak<br \/>\nEndif<br \/>\nNext I<br \/>\nRETURN<\/em><br \/>\n<em>####################################################################################<\/em><br \/>\n<strong>Here, we are checking three fields on three different screens for change in value and are accordingly enabling it. This way, APRES_MODIF can be used when we need to validate or execute a function on update of any field on the screen (not only one.) <\/strong><\/p>\n<p><strong>AM_XXX:<\/strong><br \/>\nThe AM_XXX is a field action assigned against any specific field of the screen dictionary. Thus the action is fired whenever any change is registered against the specific field.<br \/>\n<a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2012\/02\/AM_REGDAT.bmp\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-166\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2012\/02\/AM_REGDAT.bmp\" alt=\"\"><\/a><br \/>\n<strong><span style=\"text-decoration: underline;\">Code View:<\/span><\/strong><br \/>\n<em>####################################################################################<\/em><br \/>\n<em>## Section automatically added (screen XDM0) <\/em><br \/>\n<em>####################################################################################<\/em><br \/>\n<em>Subprog AM_REGDAT (VALUER)<\/em><br \/>\n<em>Variable Date VALUER<\/em><br \/>\n<em>If VALUER &gt; date$<\/em><br \/>\n<em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Infbox \u201cThe registration date cannot be greater than current date.\u201d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/em><br \/>\n<em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mkstat = 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/em><br \/>\n<em>Endif&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/em><br \/>\n<em>End<\/em><br \/>\n<em>####################################################################################<\/em><br \/>\n<strong>This way, the AM_XXX action can be used for the validation of a specific field or to fire functions specific to that field.<\/strong><br \/>\nHope this clarifies the confusion between the 2 actions.<\/p>\n<p>Enjoy Coding in X3. &nbsp;For some quick help please free to contact us on <strong>x3@greytrix.com<\/strong><\/p>\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br \/>\n<a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> \u2013 a globally recognized Premier Sage Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM needs. Being recognized and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development and implementation expertise.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>&nbsp;caters to a wide range of Sage Enterprise Management (Sage X3) offerings \u2013 a Sage Business Cloud Solution. Our&nbsp;unique GUMU\u2122 integrations include <a href=\"https:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\">Sage Enterprise Management (Sage X3) for Sage CRM<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Salesforce.com<\/a> and&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\">Magento eCommerce<\/a>&nbsp;along with Implementation and Technical Support worldwide for <a href=\"https:\/\/www.greytrix.com\/africa\/services\/#Implementation\">Sage Enterprise Management (Sage X3)<\/a>. Currently we are <a href=\"https:\/\/www.greytrix.com\/africa\">Sage Enterprise Management Implementation Partner<\/a> in East Africa, Middles East, Australia, Asia.&nbsp;We also offer best-in-class&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\">Sage X3 customization and development services<\/a>,&nbsp;integrated applications such as <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/pos-system\">POS<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/warehouse-management-system\">WMS<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/payment-gateway\">Payment Gateway<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/shipping-system\">Shipping System<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/business-intelligence\">Business Intelligence<\/a> | <a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/ecommerce-magento-integration\">eCommerce<\/a> and have developed add-ons such as <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-add-ons\/catch-weight\">Catch \u2013 Weight <\/a>&nbsp;and <a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-add-ons\/letter-of-credit\">Letter of Credit<\/a> for Sage Enterprise Management to Sage business partners, end users and Sage PSG worldwide.<\/p>\n<p>Greytrix is a recognized <a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2017\/07\/26\/greytrix-on-boards-sage-global-rockstar-isv-program-with-gumu-for-sage-crm-sage-x3-solution\/\">Sage Rockstar ISV Partner<\/a> for GUMU\u2122 Sage Enterprise Management \u2013 Sage CRM integration also listed on <a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noopener\">Sage Marketplace<\/a>; GUMU\u2122 integration for Sage Enterprise Management \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n<p>For more information on Sage X3 Integration and Services, please contact us at&nbsp;<a href=\"mailto:x3@greytrix.com\">x3@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have come across many technical queries regarding the actions of Sage ERP X3, one of them was \u201cCould anybody tell me what is the major difference between field after the change (AM_XXX) and APRES_MODIF events, and which of them better to use?\u201d It quite true that in X3 with so many events at our\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2012\/02\/18\/difference-between-x3-actions-apres-modif-vs-am-xxx\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[49,119,2472,131,2471],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","tag-actions","tag-am","tag-am-xxx","tag-apres","tag-apres-modif"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/165","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":3,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":27533,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/165\/revisions\/27533"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}