How to Display fields on basis of catalog task

puneetgoels1
Tera Guru

In my workflow, there are around 20 catalog tasks and there are 100 fields all together. I need to display selective fields on the basis of catalog task e.g. task 1 show 5 fields and hide others, task 2 show 10 fields and hide others and like wise.

How can it be achieved efficiently?

1 ACCEPTED SOLUTION

puneetgoels1
Tera Guru

Correct Answer: Catalog UI Policy or UI policy do not work on the conditions on short description of task. It works only for catalog item variables and short description like fields be it at request item level or catalog task level in scoped application.



So the way to achieve it is write a UI policy at global level, put a condition for the catalog item and use the script to implement it


View solution in original post

40 REPLIES 40

open the Task like below then right click on header bar> Configure> Client Script > New



should be on load script



find_real_file.png


Another concern, If there are two parallel task, that hidden field will have the last value and it will show the fields according to that for both the tasks. How to cater that?


All task will be having individual value for that hidden field. So it doesn't matter if the task are parallel in WF. You try this approach it will work.



Thanks,


Arindam


Field is at item level. So in case of parallel tasks both will have same


value



On Wed, Aug 23, 2017 at 4:47 PM arindamghosh.net <


field should be on sc_task table. and you need to write the script inside the catalog task block to initialize the value



for example script should like below:


For Task1 : task.u_new_field = option1


For Task2 : task.u_new_field = option2



Now for task 1 write a client script on sc_task table:



Disply all required fields fields when u_new field value = option1 using below script: do same for all tasks



function onLoad() {


var value = g_form.getValue('u_new_field ');


if (value == 'option1')){


g_form.setDisplay('u_app_team_assignment_group',true);


g_form.setDisplay('field2',true);


g_form.setDisplay('field3',true);


g_form.setDisplay('field4',true);


  }


}



Hope this would help.



Thanks,


Arindam