Skip to main content
Question

FSM Smart Client - Load FSM dropdown using Client Script.


Forum|alt.badge.img+8

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.

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

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 = reasonResults[i]["description"];
	var reasonCode = reasonResults[i]["code_value"];
	arrayPush(opt1, createCodeTableOption(reasonCode,reasonDescription));  
}
setControlOptions('task', 'user_def6', opt1);

Cheers!


SAMLK
Hero (Partner)
Forum|alt.badge.img+13
  • Hero (Partner)
  • January 31, 2024

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


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

@SAMLK 

I missed the title ðŸ˜‘

Cheers!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings