How to get the sys_id of the current HR case from a HR task using Catalog client script? Pls advise!

SREE HARSHA NS
Tera Contributor

How to get the sys_id of the current HR case from a HR task using Catalog client script? Pls advise!

6 REPLIES 6

Brad Bowman
Kilo Patron
Kilo Patron
g_form.getValue('parent');

@Brad Bowman  
Thank you for the  quick response! If you don't mind, could you please send me the full catalog client script to fetch the sys_id of HR Case( from a HR task) and store the value in the catalog variable(task_sys_id)?

If you want to do this when the HR task form loads/is viewed, then it would look like this:

function onLoad() {
    g_form.setValue('task_sys_id', g_form.getValue('parent');
}

If the variable is a single line text it will show the sys_id.  If the variable is a reference to the HR Case table then it will show the Case Number, just like the Parent field on the task does.

@Brad Bowman  Thanks!
I tried the same in my catalog client script , the catalog variable 'task_sys_id' is a single line text type field but it is not fetching sys_id of the HR case record which is created.
any advise, please?