How to display HR catalog variable editor(Available for HR Case form) to its child HR Task form

gowthamanbalu
Tera Contributor

Hi All,

      I got a requirement to display HR catalog variables to its HR Case(Parent table) form as well as HR Task(Child table) form. Displaying variables to the parent table(i.e. HR Case form) is already in place as OOB function. But I am struggling to display the same variables to its child table(i.e. HR Task form). Could anyone please help to progress on this requirement..

4 REPLIES 4

Duaine Johnson1
Giga Expert

Hi,


Did you ever find a resolution to this? I am facing the same problem and am not sure how to proceed.



Thanks,


Duaine.


gowthamanbalu
Tera Contributor

Hi,



Please refer the thread Newly created Variable Editor on Change Request and Change Task not showing I have applied the below logic and it works well. But this can not be used for reference type variables.For reference variables, it will show the sys_id not the value.



var todo = '';


var hrvar = new GlideRecord('question_answer');


hrvar.addQuery('table_sys_id', current.sys_id);


hrvar.setLimit(50); //just for security


hrvar.orderBy('order');


hrvar.query();


while (hrvar.next()){


  if (hrvar.question.type != 11 && hrvar.value != ''){


  todo += '<tr><td align = "left"><i><b>' + hrvar.question.getDisplayValue() + '</b></i></td><td>: </td><td>' + hrvar.u_custom_value + '</td></tr>';


  }


  if (hrvar.question.type == 11){


  todo += '<tr bgcolor = "#f6f6f6"><td colspan = "3" align ="left"><b></b></td></tr><tr bgcolor = "#f6f6f6"><td colspan = "3" align ="left"><b>' + hrvar.question.getDisplayValue() + '</b></td></tr>';


  }


}


var todoFinal = '<table>' + todo + '</table>';


current.u_to_do = todoFinal;



Regards,


GB


matt v_
Mega Expert

I know this is a bit old now, but I am having a similar issue.   I want to show the HR Case variables on the HR Task form.   I made a copy of the formatter and changed the table to hr_task, but I must be missing something.   I'm assuming there needs to be some kind of reference to the parent case, but am not sure how to go about that.



Were you able to find a way to accomplish this?