Hi @ajayifs
Which client is it?
If this is for the Webclient you can use setControlOptions.
setControlOptions('table', 'field', array);
Code eaxample
var opt1 = ];
var reasonResults;
if (selectedTAskStatus == 'INCOMPLETE') {
reasonResults = getDBValues('C_SELECT_INCOMPLETE_STATUS_COMMENT');
}
if (selectedTAskStatus == 'HOLD') {
reasonResults = getDBValues('C_SELECT_HOLD_STATUS_COMMENT');
}
if (selectedTAskStatus == 'CANCELED') {
reasonResults = getDBValues('C_SELECT_CANCELED_STATUS_COMMENT');
}
if (selectedTAskStatus == 'REJECTED') {
reasonResults = getDBValues('C_SELECT_REJECTED_STATUS_COMMENT');
}
//log(reasonResults.length);
for(var i = 0; i < size(reasonResults); ++i)
{
var reasonDescription = reasonResultsli]["description"];
var reasonCode = reasonResultsli]["code_value"];
arrayPush(opt1, createCodeTableOption(reasonCode,reasonDescription));
}
setControlOptions('task', 'user_def6', opt1);
Cheers!
Hi @ajayifs ,
I believe you are intending to write a client script for the smart client dropdown according to the title. Unfortunately you will not be able to achieve this via the smart client but as @Shneor Cheshin mentioned, you can write a web client script to dynamically populate the dropdown. Also, if you are using global codes or code tables, there is already a column to define access group to limit the value for the intended users, but can be a little messy if you want to populate the same for several access groups. There are many other options like changing the dropdown to a lookup, usage of lookup xml in ui designer, using the global code hierarchy etc. that are available in the community forum itself.
@Shneor Cheshin is the best to reach out for your requirement imo :)