Ir al contenido principal

How to filter Local Menu in Sage X3 (GMENLOC)

Fuente original: Greytrix https://www.greytrix.com/blogs/sagex3/2013/10/28/how-to-filter-local-menu/

By  | October 28, 2013



InIn X3, we developer may come across with the requirement where we need to filter the local menu values for the fields. There are simple techniques available in X3 to filter the local menu values.

Follow the below steps to filter the local menu field records:

  1. 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.
  2. Add Before entry field action on that field.

LocalMenu1

  1. 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.

LocalMenu2

  1. 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.

LocalMenu3

Entradas populares de este blog

Valores de fstat

Fstat fstat  is a numeric status that is returned upon execution of a database operation, a sequential file operation, or a lock instruction. Syntax fstat Examples # MYTABLE is a table with a key called KEY1, that has a unique component called KEYVAL # Create a record in the table MYTABLE with they key value 1 if it doesn't exist Local File MYTABLE [MYT] Read [MYT]KEY1=1 If fstat [MYT]KEYVAL=1 : Write [MYT] If fstat MSG="The key was created in the mean time" Else MSG="Key created" Endif Else MSG="Key already exists" Endif Details fstat  is always set to '0' if the operation is successfully completed, and has a non-null value if there is an error: In a sequential read ( Getseq  and  Rdseq ),  fstat  is set to '1' at the end of the file. On  Lock ,  fstat  is set to '1' if the lock could not be performed. For a database operation ( Read ,  Look ,  Readlock ,  For ,  Write ,  ...

3 ways to send a mail from code in Sage X3, with more attachments too

Origen Fuente:  https://en.sagedev.it/sagex3/send-mail-from-code-with-attachments-sage-x3/ Autor:  https://en.sagedev.it/category/sagex3/ In this post I’ll show you how to send a mail from adonix code in Sage X3. The points we will face are: 1) Meladx/Send introduction 2) Sending  through  meladx (the best way for me: at the end with just a single code line you send a mail!) 3) Sending  through  Workflow 4) Sending  through  ENVOI_MAIL(…) From AWRKMEL Sending mail from code in Sage X3: Send vs meladx Sage X3 has two native ways for sending mails. The first way is  meladx  executable file, that you can find in  runtime\bin  directory. The seconde one is Send instruction, that was used to send mail through an application of the client station (for more information on “Send GSERMES”  go here ). The Meladx executable Meladx send messages through SMTP/POP3 protocols by means of the mail  ...

Sage X3 Create a new CLOB Text

Here how to create a CLOB text Funprog F_CRELOB ( YABRFIC , YTEXTE ) Value Char YABRFIC Value Char YTEXTE Local Char XXRTFTXT ( 250 ) ( 3 ) XXRTFTXT ( 0 ) = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}}\viewkind4\uc1\pard\f0\fs17 " XXRTFTXT ( 1 ) = YTEXTE XXRTFTXT ( 2 ) = "\par}" Local Char X_RET Local Integer XXOK Local Char XCHAMPLIEN : XCHAMPLIEN = "YYYY" Global Char YYYY : YYYY = YABRFIC Local Clbfile WWCLOB Local Mask ACLOB [ M :ACL ] Setlob WWCLOB With XXRTFTXT [ M :ACL ] CLOB = WWCLOB Call CRE_CLOB_ACL ( XCHAMPLIEN , XXOK ) From TRTX3TEX Close Local Mask [ M :ACL ] X_RET = YYYY Kill YYYY End X_RET