Question

Custom Fields

  • 30 November 2021
  • 2 replies
  • 407 views

Userlevel 1
Badge +3

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.  

 


This topic has been closed for comments

2 replies

Userlevel 7
Badge +31

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:

https://docs.ifs.com/techdocs/foundation1/040_administration/220_user_interface/020_custom_objects/040_custom_fields/020_create_custom_fields/020_add_edit_readonly_attribute.htm

Hope this helps!

Userlevel 5
Badge +17

@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: https://docs.ifs.com/techdocs/foundation1/040_administration/220_user_interface/020_custom_objects/040_custom_fields/020_create_custom_fields/steps_itd/set_PersistentReference.htm?nobanner=true