Skip to main content

We have a business requirement to filter the list in one of the combo box/dropdown in FSM screen based on the user's access group.
Currently, the this dropdown field display value without filtering through configured lookup in metadata.

Is it possible to filter this list based on Client Script. For example, we get data to be shown inside dorpodown in the client script, lopp through the values and add them to the dropdown list.

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 :)


@SAMLK 

I missed the title 😑

Cheers!


Reply