Custom Fields

  • 30 November 2021
  • 2 replies

Badge +1

I have added in a custom field (Commodity Code 3) into the inventory part screen, this is a LOV field and works fine. (Pulling from Commodity_Group)

I have been attempting to add another field which auto populates the description from this LOV based on the selection made.  I have tried using a reference (both persistent and read only) and an expression but so far everything I have tried does not populate - what’s the best way to achieve this?


I am assuming that a select or expression statement would be best but the correct syntax is escaping me.  


2 replies

Userlevel 7
Badge +15

Hi @K.mitch,

According to your description, a Read Only field with a SELECT statement should work for this. For an expression type custom field, you would need a get method to retrieve the relevant value. 

Assuming your field name is Commodity_Code_3 and it is in the header of Inventory Part window. 

The corresponding field name you should refer in your select statement would be CF$_Commodity_Code_3

So an example SELECT statement would be like following:

SELECT CF$_Commodity_Code_3 FROM Inventory_Part_CFV WHERE part_no=:part_no

Here you should give part_no or any other appropriate value in the WHERE clause as an argument when defining the select statement to make sure that your select statement returns only one value. That argument should be defined in the Arguments field as well like in below screenshot. 

You can find the documentation for read only custom fields here:

Hope this helps!

Userlevel 5
Badge +8

@K.mitch Is there any reason you want the description in a separate field and aren't just including the description in the custom field itself?

The documentation shows this quite nicely that you can e.g. combine PART_NO and DESCRIPTION as the display value in an LOV type custom field: