How to find the Number of Fields of an Open Table in Sage X3 (Sage Enterprise Management)

In some cases, a developer might come across the situation where they would like to know the name of the fields & number of the table, here is how it can be done-

 Sage ERP X3 has a special feature of getting field’s name of the table with the help of “adxfname” keyword which will return you the value & field codes.

Follow the Description & Syntax to achieve this:

Adxfname is a variable table of the [G] class associated with an open table by a File command. The adxfname dimension is given by the [G]nbzon variable (number of fields defined in the table). adxfname contains the field name of the corresponding table. This variable is only accessible in read mode.

  • Nbzon determines the number of fields of an open table. This variable is only accessible in read mode.
  • Adxfname determines the name of the fields of an open table.
  • Tairec contains the size in number of bytes of each record in an open table.

Syntax:

[G: abv] adxfname (dim)

[G] – class associated with a table declared by a File command. 

abv:   Abbreviation of the table.

dim:   Index number of the table.

Example-

Refer to the below snippet of code for a better understanding-

Fig 1: Considering purchase order table (PORDER).

Fig 2: In this example, there are 117 fields in the purchase order table.

Fig 3: The fields are started with field names.

Fig 4: Shows the total size of the record.

By using these 4gl index keys a user can find the number of fields & size of the data in a table.

For more information on Sage X3 Integration and Services, please contact us at info@akaasa.edev99.in 

We will be glad to assist you.

GerminIT

Cloud ERP Consultation In India

Subscribe

Leave a Reply

Your email address will not be published. Required fields are marked *