I am successfully built a dynamic drop down list using the :ui.add() function. However, does anyone know how do I control the dropdown code vs dropdown display value? The :ui.add() function seems to be able to work well for just the Code or it sets the generated HTML for Dropdown the same value for both code and description. The following is my code in the On User input trigger of the Country_Lookup field. The last statement will setup my State_Dropdown field dynamically.
v_country_rec = Lookup_Codes [ID == input.Country_Lookup];
v_state_province_list = Lookup_Codes [(Lookup_Type == "STATE_OR_PROVINCE" && Context_Code == v_country_rec.Lookup_Code)] sort by Lookup_Code ;
State_Dropdown:ui.add(v_state_province_list.Lookup_Code.getall());
This works very well except that I can only populate with one set of value for the Code. But I can't add description to it. Perhaps the syntax that I am hoping to do is like the following:
State_Dropdown:ui.add(v_state_province_list.Lookup_Code.getall(), v_state_province_list.Description.getall());
But this does not work. So is there any way to control the Description field in Dynamic dropdown list?
Any help is appreciated. Thanks.