- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 02:06 PM
Hi All,
I ran into an strange issue.
I have created a Application scope and from that Application scope i have added a field to the Table which is in Global Application scope. Now I want to delete that field but I don't know for some reason i was unable to see the Delete button to delete that Field
Can someone please let me know the possible reason for this and a way to delete that Field.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 04:11 PM
You can use below background script to delete column.
Again, make sure that you are in correct scope
Following is sample code. Change query as per your requirement.
var dict = new GlideRecord('sys_dictionary');
dict.addEncodedQuery('name=u_test_fix^element=u_out');
dict.query();
while(dict.next()){
dict.deleteRecord();
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 03:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 03:49 PM
I already made that Inactive but I want to delete that field completely from the table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 04:11 PM
You can use below background script to delete column.
Again, make sure that you are in correct scope
Following is sample code. Change query as per your requirement.
var dict = new GlideRecord('sys_dictionary');
dict.addEncodedQuery('name=u_test_fix^element=u_out');
dict.query();
while(dict.next()){
dict.deleteRecord();
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 04:19 PM
Hi Sachin,
Can you please let me know what is the Query and what I should give
I am little confused with that query.
Should I give like
var dict = new GlideRecord('sys_dictionary');
dict.addEncodedQuery('name=my field name^element=u_out');
dict.query();
while(dict.next()){
dict.deleteRecord();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 04:21 PM
Please use below sample
dict.addEncodedQuery('name=u_test_fix^element=u_out'); // name is table name and element is column name.
Regards,
Sachin