Collapse Variables on sc_req_item record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 5 hours ago
Hi everyone,
I’m trying to make the Variable Editor (com_glideapp_servicecatalog_veditor) on the RITM form (table: sc_req_item) load with all containers (like User Info, Details, etc.) collapsed by default.
What I’ve tried so far:
Created a system user preference with:
<sys_user_preference> <name>sn_sc.VariablesEditorState</name> <value>collapsed</value> <type>string</type> <system>true</system> </sys_user_preference>— but this didn’t change the behaviour.
Added an onLoad Client Script on sc_req_item:
function onLoad() {
(function collapseVE() {
try {
var ve = window.g_sc_form && window.g_sc_form.variableEditor;
if (!ve) return setTimeout(collapseVE, 100);
if (Array.isArray(ve._sections)) {
ve._sections.forEach(function (sec) {
if (sec) sec.expanded = false;
});
}if (typeof ve.render === 'function') ve.render();
} catch (e) {
console.log('VE collapse failed:', e);
}
})();
}— but the Variable Editor still loads expanded, and the script doesn’t seem to affect the initial state.
My goal:
When viewing an RITM, I’d like all variable containers to be collapsed by default (like how they appear when manually collapsed in the form), rather than fully expanded on load.
Question:
Is there a supported or recommended way to make the Variable Editor load collapsed by default?
Any guidance would be much appreciated!
Thanks in advance,
Puneet
- Labels:
-
Request Management