- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 06:17 AM
First in that table field we select a table let's say it is incident table
Second, in the column field we will only be shown the fields for that incident table and we select one out of those columns
Third, this field will show all the records from the incident table and when we select a record then it will show the content of its Short description of that record ....
Note that we assume that no matter what table we select that table contains a short description field.
Thanks.
Please help me out
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 03:12 AM
BTW i finished the work xD
// onChange ClientScript for table-field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('recordColumnContent');
ga.addParam('sysparm_name', 'columnContent');
ga.addParam('tableId', g_form.getValue('u_table'));
ga.getXMLWait();
var answer = ga.getAnswer();
alert(answer);
// ga.addParam('sysparm_name', )
// ga.addParam('currentColumn', g_form.getValue('u_column'));
}
/*----------------------------------------------------------------------------------- */
// onChange ClientScript for column-field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var ga = new GlideAjax('recordColumnContent');
ga.addParam('sysparm_name', 'gettingColumnValue');
ga.addParam('currentColumn', g_form.getValue('u_column'));
ga.getXMLWait();
}
/*------------------------------------------------------------------------------------ */
//The required script include :
var recordColumnContent = Class.create();
recordColumnContent.prototype = Object.extendsObject(AbstractAjaxProcessor, {
columnContent: function()
{
gs.log('Entered Script Include', 8974);
var tableId = this.getParameter('tableId');
gs.log('Table sys_id :'+tableId, 8974);
var tableName='';
var dictionary = new GlideRecord('sys_dictionary');
var sysDbObj = new GlideRecord('sys_db_object');
sysDbObj.addQuery('sys_id', tableId);
sysDbObj.query();
//if(sysDbObj.next())
//{
sysDbObj.next();
tableName = sysDbObj.name;
gs.log('table name :'+sysDbObj.name, 8974);
// }
dictionary.addQuery('element', 'u_content');
dictionary.query();
//if(dictionary.next())
//{
dictionary.next();
gs.log('Current Table in Reference:'+dictionary.reference, 8974);
dictionary.reference = sysDbObj.name;
dictionary.update();
gs.log('Reference After:'+dictionary.reference, 8974);
//}
},
gettingColumnValue: function()
{
var currentColumn = this.getParameter('currentColumn');
gs.log('The current Column'+currentColumn, 8972);
var gr = new GlideRecord('sys_dictionary');
gr.addQuery('sys_id', currentColumn);
gr.query();
gr.next();
gr.display= true;
gs.log('Display Value of the column'+gr.element+' is '+gr.display, 8972);
gr.update();
},
type: 'recordColumnContent'
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 06:34 AM
Your question does not make sense. I think you need to re-write this to be clear.
In your example above, the second step doesn't do anything to change the third step. In step two you say you select one of those columns, but in step three you show all records from the table. If you are showing all records, are you only showing that one column?
Also, in step one, not all tables have a short description, so do you want to filter by tables which only have short description?
Is your desired result to have a form to do this? How many tables do you really want to look through? Incident, problem, change? What beyond that? Projects, SIR, etc? What type of user would be looking through all tables, picking columns to ultimately see a short description. Seems like a horrible user experience and I suspect you will have access control issues where most users will not be able to see either the table, column or short description. Maybe more information on the use case and what you are trying to achieve may help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 01:34 AM
Thanks Jeff .... you are too intelligent LOL

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 03:59 AM
I didn't intend any disrespect, I just couldn't follow what you were trying to achieve.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2019 02:48 AM
Fully agreed with you Jeff!! Question doesn't make any sense.
Abhishek Gardade