- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 12:10 AM
Hi All,
I am working on Application table(cmdb_ci_appl) how do I get only fields which are on form not all class fields.
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 06:02 AM
Hi,
Check this, It may help you.
function onLoad() {
var arr = [];
for (var x = 0; x < g_form.elements.length; x++) {
arr.push(g_form.elements[x].fieldName);
}
alert("array value = " + arr);
}
Thanks,
Dhananjay.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 12:14 AM
Are you trying to do it using scripts ?
If yes this script can help you
function onLoad() {
try {
var getFields = document.getElementById('variable_map').getElementsByTagName('item');
for(var i = 0; i < getFields.length; i++)
{
var field= getFields<i>;
g_form.setDisplay('variables.' + field.getAttribute('qname').toString(), false);
}
} catch(err) {}
}
FYI:This script uses DOM Manipulation which is not a best practice and also to run this script you have disable to isolated script setting on the client script page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 12:57 AM
is there any OOB way available?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 01:01 AM
I don' think there is any OOTB way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2020 01:17 AM
Hi,
I tried same, but nothing I am getting.
Do I need to change anything?
Thanks.