- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2018 08:03 AM
Hi everyone,
I am trying to create a script that will automatically add field to a table.
Is there a way I can do this? maybe by adding a record to sys_dictionary?
I tried to do that by using GlideRecord but it didn't work.
Any ideas?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2018 09:20 AM
I just created my own app and scoped table. WHen I executed it on scoped app, it gave me cross-scope-privilege error.
I executed it in Global scope and it worked.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2018 08:35 AM
Can you share your script?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2018 08:58 AM
var r = new GlideRecord('sys_dictionary');
r.initialize();
r.active = 'true';
r.internal_type = 'string';
r.name = 'my_table_name';
r.column_label = 'Field 1';
r.element = 'field1';
r.max_length = 40;
r.table_reference = 'false';
r.insert();
Not working 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2018 11:44 AM
I used below script. it worked fine. I also added the sys_scope field and commented the active=true
var r = new GlideRecord('sys_dictionary');
r.initialize();
//r.active = 'true';
r.internal_type = 'string';
r.name = 'incident';
r.column_label = 'Field 1';
r.element = 'field1';
r.max_length = 40;
r.table_reference = 'false';
r.sys_scope='global';
r.insert();
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2018 01:11 AM
Sorry, not working 😞
I need it in a specific scope so I tried to use the following line:
r.sys_scope = 'SYS_ID_OF_SCOPE';
And when it didn't work I tried your line referring to the global scope.
Both didn't work 😞
I read somewhere that there is a utility called GlideTableCreator, but I can't find any reference about it, so I can't try it. Maybe someone knows anything about it?