Hi.Community...how to get table name dynamically?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 03:15 AM
Hi
I have a field called 'equipment' and its referring to 'cmdb_model_category' table. based on model category selection i need to get the table of that category.
below the model category, i have selected computer so i need the table name of computer dynamically. How i can achieve that please help me out.
currently m only getting the sys_id of computer but i need the table name too.
function ShowClient(){
var equipment_val = gel('equipment').value;
;
if(equipment_val==''){
alert("Please Select Equipment");
return false;
}else{
//var url = ""need to get table name dynamically".do?sys_id=" + equipment_val;
window.open(url,"width=50, height=50");
}
}
Thanks
Prakash Ranjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 03:40 AM
Hi
As m using UI pageand there is client script . so there i tried with with both
current.getTableName() and g_form.getNableName().. but its not working.
any ways as its client script so current will not work ri8.....so any other way to get the table..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 03:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 04:02 AM
Where are you doing this? It sounds like you are in a server script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 04:07 AM
Hi
I am using this on client script in UI Page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2016 04:28 AM
Hi Prakash,
This is an UI Page. It need not be associated with any table by default. So there is no g_form/gs/current/previous function that can be used to fetch required information.
Try to get the table name / information related to it just the way you have done for "equipment_val" from one of the html element and this completely depends on luck.
If you are trying to call this ui page in a glideDialogWindow, you can make tablename value available by using "setPreferences()". But again, a glideDialogWindow is called from a client script/ui action which is usually associated with table.