- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Included in the Developer Toolbox Update Set available on Share (link to Share in the post).
Here are some Context Menus and UI Actions that will open the schema map UI Pages in a new tab/window in your browser. The "(Old)" versions will open the pre-Calgary (but still shipping) "schema_map2" UI Page and the others will open the newer "generic_hierarchy_erd" page.
They appear in the context menus for both forms and lists (including related lists):
Here is the newer page:
And the older one (pre-Calgary):
Here are the details of the list Context Menus:
Name: Show Schema Map
Table: Global [global]
Menu: List Header
Type: Action
Order: 500,100
Active: checked
Condition: gs.hasRole("admin")
Action script:
(function(){
var attributes = "table_history=";
attributes += ",table=" + g_list.tableName;
attributes += ",show_internal=true";
attributes += ",show_referenced=true";
attributes += ",show_referenced_by=true";
attributes += ",show_extended=true";
attributes += ",show_extended_by=true";
attributes += ",table_expansion=";
attributes += ",spacing_x=60";
attributes += ",spacing_y=90";
attributes += "nocontext";
//setup the proper URL
var gUrl = new GlideURL("generic_hierarchy_erd.do");
//add the attributes as a parameter
gUrl.addParam("sysparm_attributes", attributes);
//then open in a new tab/window
g_navigation.open(gUrl.getURL(), "_blank");
})();
Name: Show Schema Map (Old)
Table: Global [global]
Menu: List Header
Type: Action
Order: 500,100
Active: checked
Condition: gs.hasRole("admin")
Action script:
(function(){
//setup the proper URL
var gUrl = new GlideURL("schema_map2.do");
//add some parameters
gUrl.addParam("sysparm_stack", "no");
gUrl.addParam("sysparm_attributes", "table=" + g_list.tableName);
//then open in a new tab/window
g_navigation.open(gUrl.getURL(), "_blank");
})();
And the details on the form UI Actions:
Name: Show Schema Map
Table: Global [global]
Order: 100,000
Action name: u_fpc_show_schema_map
Active: checked
Show insert: checked
Show update: checked
Client: checked
Form context menu: checked
Hint: Display a schema map of this table in a new tab/window
Onclick: uFpcShowSchemaMap()
Condition: gs.hasRole("admin")
Script:
function uFpcShowSchemaMap(){
var attributes = "table_history=";
attributes += ",table=" + g_form.tableName;
attributes += ",show_internal=true";
attributes += ",show_referenced=true";
attributes += ",show_referenced_by=true";
attributes += ",show_extended=true";
attributes += ",show_extended_by=true";
attributes += ",table_expansion=";
attributes += ",spacing_x=60";
attributes += ",spacing_y=90";
attributes += "nocontext";
//setup the proper URL
var gUrl = new GlideURL("generic_hierarchy_erd.do");
//add the attributes as a parameter
gUrl.addParam("sysparm_attributes", attributes);
//then open in a new tab/window
g_navigation.open(gUrl.getURL(), "_blank");
}
Name: Show Schema Map (Old)
Table: Global [global]
Order: 100,000
Action name: u_fpc_show_schema_map_old
Active: checked
Show insert: checked
Show update: checked
Client: checked
Form context menu: checked
Hint: Display a schema map of this table in a new tab/window (old version of UI Page)
Onclick: uFpcShowSchemaMapOld()
Condition: gs.hasRole("admin")
Script:
function uFpcShowSchemaMapOld(){
//setup the proper URL
var gUrl = new GlideURL("schema_map2.do");
//add some parameters
gUrl.addParam("sysparm_stack", "no");
gUrl.addParam("sysparm_attributes", "table=" + g_form.tableName);
//then open in a new tab/window
g_navigation.open(gUrl.getURL(), "_blank");
}
I've attached XML files so you can just import them into your instance. As always, try it out in your company's development instance first, or better yet, your own personal development instance.
Note: Based on an article by Mark Stanger over on the ServiceNowGuru site.
Note: This is an updated version of this article - Showing a Schema Map From a List View
- 1,197 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.