- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone,
I’m new to using setVisible in a Catalog Client Script and I’m hoping I’m missing something simple.
Goal / expected behavior
- I have a Catalog Item with variables visible to the requester and one internal-only variable that’s hidden on the form.
- After the item is submitted, I want that hidden variable to become visible for our internal team to use.
- The variable is a Multiple Choice named
action.
What I tried
g_form.setVisible('action', true)andsetDisplayin a client script.
Client script
function onSubmit() {
if (g_form.isNewRecord()) {
g_form.setVisible('action', true);
}
}Question
Do I need to handle this with an onLoad / onChange Catalog Client Script (or a Catalog UI Policy), and/or use a Script Include to control visibility for the internal team after submission?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Kirle
Create a UI Policy without any conditions - and uncheck both Applies on Catalog Tasks and Applies on Requested Items
and in the UI Policy Action select variable and set Visible as False
This will make the variable hidden on the catalog form and not on RITM and Task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you so much. Is it possible to actually do it with an onSubmit client script?
I am just dying to know what I did wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank everyone. It worked!
