- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 02:13 PM
Hi,
I have this record producer with a few variables set hidden=true. In ITSM, I would normally set the property: global=true so that they become visible on the RITM or Task when setVisibility in the UI Policy or Catalog Client Scripts set them to true. In the Employee Center (EC) Portal, the variables are working as expected. That means, they are hidden on load as the hidden=true, then becomes visible when a certain selection is selected. However, when the request is submitted, in the HR Case form, all these fields set to hidden=true are not visible even if they were visible on the EC portal.
I had to set them to hidden=true because all these fields become visible in the HR Case form even if the UI Policy or Client Scripts set them to hidden. It works in the EC portal, but the HR case form is always problematic. Am I missing anything?
I've attached the variables attribute for your guidance.
Help please. Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 06:09 AM
Have you created any client script or UI policy for visibility of required variables that are applied on the HR case table? Because as per my understanding you have added client script but that was only applies on the target records and catalog item view.
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 06:09 AM
Have you created any client script or UI policy for visibility of required variables that are applied on the HR case table? Because as per my understanding you have added client script but that was only applies on the target records and catalog item view.
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 06:36 PM
Hi @Dnyaneshwaree ,
Thank you for your reply. I wasn't aware that hidden variables in HR Cases needed to be set through UI policies or Client Scripts. This is different from how it works in ITSM. 😑
Following your advice, I created a Client Script. Initially, I encountered a roadblock because I used the setVisible method, which didn't work. However, it worked when I used setDisplay.
For others who might be facing the same issue, here's the test code I used to make the variable visible (or invisible if it doesn't need to be shown on the Case form):
function onLoad() {
var hr_service = 'whatever_sys_id_or_get_property_here';
if (g_form.getValue("hr_service") == hr_service){
var request_type = g_form.getValue("variables.request_type");
if(request_type == "0"){
g_form.setDisplay("variables.chosen_one", true);
}
else
g_form.setDisplay("variables.chosen_last", true);
}
}
}