Variable section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 01:50 AM
Hi All,
Variable section should visible only if incident raised through service portal but If any user raise incident through Like All-->Incident--> create new the Variable section should not visible in incident form.
I have added in Section Incident Variable Editor in incident form design and written below client script for variable read-only this is working fine but If user raised incident using All-->Incident--> create new the variable section showing empty.
g_form.setVariablesReadOnly(true);
Please suggest for this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2024 04:59 AM
@ashok17 Variable editor is a UI macro. Its not a field or section on the form which you can hide and show conditionally using client script or UI polict. I would suggest below steps
1) Create section on the incident for and add "Variable editor" into it.
2) Create client script to hide section itself if any mandatory variable has empty value. In my case, "Urgency" is mandatory variable so I am using it in client script.
function onLoad() {
//urgency is one of the mandatory variable, you can use any mandatory variable from your record producer
if (g_form.getValue('current.variables.urgency') == null) {
g_form.setSectionDisplay('variables', false);
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!