Delete Button not Visible

ursnani
Giga Guru

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.

1 ACCEPTED SOLUTION

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

View solution in original post

12 REPLIES 12

Thanks a lot sachin it worked and i was able to delete the field by using script you provide.

But why is the Delete Button not visible still a puzzle for me

Delete column  UI action is using below condition

 

!current.element.nil() && !current.name.nil() && current.canDelete() && new DictionaryUtils().isDeletable(current)

 

You can check logic to allow deleting column with isDeletable() function in DictionaryUtils script include.

 

Regards,

Sachin

Thanks a lot Sachin,

I checked the Script Include and found the Issue with mine.

Actuallt Delete Column Button will be visible only for field starting with "u_" or "x_" (as all the field in Application scope starts with x_).

But in my case My scope starts with name so i have specified my Scope name and now I can see the "Delete Column" Button.

Really Appreciate for your help.