Sage X3: Understanding How To Add Action to the Field
During development in Sage X3 you may be required to update certain fields based on one field value. Did you know that this can be performed with the Field Action option? It’s true. Read on to learn more.
Field actions are triggered by different events when the user navigates through screen fields. Field actions can be linked to direct code (sub programs found in the screen processes) or to actions from the Action dictionary.
Here is an easy-to-follow example of how to perform an action after a field is updated. If you’re interested in learning more, speak to a Mantralogix team member today! What follows below is a general technique that can be used in any field.
First, let’s look at the Customer screen and Financial tab:
In this scenario, we will update the Group customer, Risk customer and the Pay by customer to be same as Bill to customer. All values will be the same. We don’t want the users to enter each field separately.
First, we’ll set the fields to Display. This is to restrict the user from modifying the fields. We do this in the Screens where we navigate to the BPC3 screen and change the appropriate values from Enter to Display:
Now select the Bill to customer field and add the action at the bottom. We are adding an “After change” action to the field. Save and validate the screen.
SPE (Specific) means that the action handler will be handled in the specific processing file for this screen. We validate the screen and go to the General tab, from there we can access the specific processing file SPEBPC. Here we need to type in the following:
This SPE action will be called each time the value of the BPCINV field is modified. The new value is passed in the VALEUR parameter. So we assign this value to the other three fields and then we use the Affzo instruction to refresh the screen value. This way we will always change only the Bill to customer and the other fields will be synced automatically.
Need more information on Sage X3 or have questions and need assistance? Get in touch with our Sage X3 team at 1-866-320-8922 or email us at [email protected].