Fuente original: Greytrix https://www.greytrix.com/blogs/sagex3/2013/10/28/how-to-filter-local-menu/
Follow the below steps to filter the local menu field records:
- The M data type of local menu is non-modifiable however in X3 there is alternate data type is available i.e. MM whose values we can modify at the runtime. Therefore use the MM data type for the local menu which you want to filter run time as shown in the below screenshot.
- Add Before entry field action on that field.
- The GMENLOC global variable can be used to filter the local menu values. We just need to set the GMENLOC(i) variable to 1 to deactivate the local menu values. It will be more preferable to set the values to GMENLOC variable in the Before Entry field action as it gets called before get focus to the field. Refer to the below snippet of code in which for the transmittal type field I have deactivated the 3rd, 4th and 5th value.
- In the above example for the transmittal field we have deactivated the 3rd, 4th and 5th values and thus it is only showing the first 2 values.