Name
global.getAvailableFormSections
Description
Returns an array of Sys IDs that indicate which Form Sections are accesible for targeting. This is used in a Dynamic Filter Option for the sys_embedded_tour_element.form_section dynamic reference qualifier.
Script
// policyTableName is the name of the table the UI Policy
// applies to
function getAvailableFormSections(tableName) {
var formSectionIds = [];
var gr = new GlideRecord('sys_ui_form_section');
var queryString = "sys_ui_form.nameSTARTSWITH" + tableName;
gr.orderBy('position');
gr.addEncodedQuery(queryString);
gr.query();
while (gr.next()) {
if (gr.position != "0") {
formSectionIds.push(gr.sys_id.toString());
}
}
return formSectionIds;
}
Sys ID
1d0223e487611200deddb882a2e3ecba