How to get the sys_id of the current HR case from a HR task using Catalog client script? Pls advise!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 05:45 AM
How to get the sys_id of the current HR case from a HR task using Catalog client script? Pls advise!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 06:46 AM
g_form.getValue('parent');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 07:45 AM
@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)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2023 12:40 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2023 06:03 AM
@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?