List Collector Variable -Additional option to specific single HR Case

Srinath9
Tera Guru

Hii everyone,

 

We need to show an extra/additional option to a List Collector variable in an HR case form (variable's in separate section, not on HR case form), but only for a specific HR case record. The List Collector pulls options from another table using type specifications and a reference qualifier. We've implemented a script include in the ref qualifier at the variable end to handle this, but it's always hitting the 'else' condition instead of 'if'.  Any suggestions to fix this would be appreciated!
 

Reference qualifier script at the variable:

javascript:new ScriptIncludeName().functionName(current)

 

Script Include:
functionName: function(current){

    var answer = '';

    var optSysID = [];

    var optGr = new GlideRecord('table_from_which_options_are_referred');

    if(current.sys == 'sys_id_of_a_certain_hr_case'){

      optGr.addEncodedQuery('query1');

    }

   else{

     optGr.addEncodedQuery('query2');

   }

  optGr.query();

  while(optGr.next()){

    optSysID.push(optGr.sys_id.toString);

  }

  answer = 'sys_idIN' + optSysID;

  return answer;

 

If there is any modification is required or if there is any other approach, please let me know.

Thanks,

Srinath

 

1 ACCEPTED SOLUTION

Srinath9
Tera Guru

I updated the corresponding record in question_answer table with the additional option's Sys ID so that the additional option is in the Selected slush bucket.

View solution in original post

10 REPLIES 10

Srinath9
Tera Guru

I updated the corresponding record in question_answer table with the additional option's Sys ID so that the additional option is in the Selected slush bucket.