Have you ever been annoyed that you only have 10 user-defined fields available in CRS610 / OCUSMA? Or maybe you wished you could have any user-defined fields available at all in MMS002 / MITBAL?
Fear not! Custom fields are here to help!
Custom fields are exactly what they sound like: a set of fields in M3 that can be used to extend an existing M3-table. And these custom fields can be visualized in the relevant M3-program that the table is connected to, as seen below.
First off, it might be a good idea to make sure you understand what an M3 custom field is NOT in this context. It is not a direct extension of a current M3-table where you simply add a column to that table, but rather it’s an indirect extension where M3 creates a link between the table in question and a so-called CUGEX-table. A CUGEX-table is a custom-table in M3 which for all intents and purposes can be imagined as a huge blank spreadsheet where you can dump whatever data you would like. The three most commonly used custom tables are CUGEX1, CUGEX2, and CUGEX3. We will mostly focus on the CUGEX1-table here, but we will briefly mention how CUGEX2 and CUGEX3 can be used.
So how does it work? Let’s have a look!
The link between the M3-table and the CUGEX1-fields are set up in CMS080. Once there, the first step is to determine which M3-table you want the custom field to be linked to and then to know what kind of field you want to add. For instance, to create the “Custom Boolean” custom field in MITFAC in the example above, you need to enter MITFAC as the table, one of the nine Boolean fields in CUGEX1 (F1CHB1 through 9) as the field, and make sure you hit “Create” (Ctrl+1) at the end.
You will then be taken to CMS080/E where you can add some more information. Enter the description, name and category (which is just used for categorization and nothing more), and make sure to set the field upper limit to 1.
On the other hand, if you want to create a custom field as a date (like “Custom date” above) you can chose another type of CUGEX1-field when you create the link to MITFAC. The CUGEX1 fields that are ear-marked for dates are the fields F1DAT1 through 9, and if you chose this field you are presented with the options in CMS080/E as shown below.
As you can see, the options are now limited since this field (F1DAT1) is expected to only contain dates.
Additional options are available for numeric CUGEX1-fields (F1N096 through F1N996) or alphanumeric fields (F1A030 through F1A930), such as digit check method (e.g. EAN13) for numeric fields or all upper case for alpha numeric fields. It is also possible to force a selection of values for numeric and alphanumeric fields and thereby create a drop down list of options for a field. To do this, you first need to create the field connection in CMS080 and then right click the entry in CMS080 -> Related options -> Value map.
You will then be taken to CMS081 where you can set all the possible values for the fields. In the example above for field F1N196, we create three possible values 1, 2 and 3. These values are stored in a table called CUGEVM, which is another custom-table in M3 specifically used for storing these value mappings.
Note that the sequence number (Seqno) field in CMS081 determines the order in which a value will be presented in a drop-down list (see below where “Two (description)” is above “One (description)”). Also note that what will be shown in the drop-down list the is the description of the value and not the value itself, though the value that will be stored in CUGEX1 is the value (1, 2, 3).
Finally, after you have created the custom fields and linked them to the table that you want, you want to be able to show the fields in the related program. In our example, we added fields to MITFAC which is the table of MMS003, so let’s see what has to be done to show the fields there.
Note! the standard M3 functionality for displaying these custom fields within a program is only available in the H5 client. Although you can set the custom fields up in the Smart Office client, you have to do some scripting to actually be able to visualize the fields in this client. If you happen to need to see these fields in your Smart Office client, Vince have plenty of experience creating scripts for this purpose, so do not hesitate to contact us!
The first step is to go into a record in MMS003 (“Display” or “Change”, both will work), and navigate to the panel where we want to show the fields. In our case, let’s go for panel E.
We then go to Tools -> Personalize -> Custom fields
On the right side of your screen you will then be presented with the list of fields that you created in CMS080 for the appropriate table.
Drag and drop the fields where you want them on the page, though keep in mind that you are limited by an invisible grid, i.e. you cannot place the fields wherever you would like them to be.
The presentation of these custom fields is a personalization, and as such they can be shared between users, or made universal between all users/user groups with the proper administrative rights (through administration tools in the H5-client).
Once you have created the connection between the table and the CUGEX1-table, you can use these newly added fields in your program-views, as shown below for MMS003. This can be done in CMS005, but be aware that the programs that you allow for this are limited by the programs that are actually listed in CMS005 (and this is set by Infor).
The linked fields can easily be added to information categories in CMS010, which in turn can be used in custom list MI’s which are created in CMS015.
Note: The addition of fields in CMS080 is not a prerequisite for the linking of CUGEX1 with other tables in CMS010.
These custom list API’s can then be used for whatever purpose necessary, like integrations with third parties, Vince Excel (VXL) etc.
Although custom fields are a powerful tool, you should take some care before creating them. The number of CUGEX1 fields that are possible to join with another table are a limited resource, and you should not simply add fields from CUGEX1 unless absolutely necessary. However, if instead you can use CUGEX2 (numeric fields) or CUGEX3 (alpha fields) then in principle you have an unlimited number of fields you can connect to a table. The only downside of using these fields is the fact that fields in CUGEX2 and CUGEX3 cannot be shown as own fields in the M3-programs using the standard functionality. However, just as with SmartOffice, scripting can be used in the H5-client to show any CUGEX-field. As such, a good rule of thumb would be to reserve the CUGEX1 fields for data that needs to be presented as editable fields in the program used for the table in question, while CUGEX2 and CUGEX3 should be used in all other instances.