Default View Messed Up for Custom Table

steph3
Tera Contributor

It appears that my default view on my custom table has become messed up. I attempted to fix it by following the instructions I found in this thread: https://community.servicenow.com/thread/159307 However, this only created another empty section and now my default view is missing all of the fields that were in that section. I do not understand how it is supposed to work. Any guidance would be greatly appreciated!!

1 ACCEPTED SOLUTION

Mwatkins
ServiceNow Employee
ServiceNow Employee

I would remove the one that you don't want directly from the sys_ui_form table and remove any related records too. I would open all the related records first (sys_ui_form, sys_ui_form_section, sys_ui_element, sys_ui_section) and then delete them (I know some of them automatically delete by cascade behavior but can't remember which). That way you would be sure to delete all the unwanted records. Also, I would check your update sets to make sure that no remnants of the invalid forms are in there.


View solution in original post

6 REPLIES 6

veena_kvkk88
Mega Guru

This happened to me too. I had a couple of empty sections names 'label' that kept popping up even if I couldn't find their records in form sections. After multiple tries, I used 'Form Designer' to delete those empty sections and it did the trick for me.



And as for the actually sections that had fields deleted, I would suggest you go to the versions in the 'Configure Form Layout' and revert to the older version that had the default view right.


Mwatkins
ServiceNow Employee
ServiceNow Employee

Hi Stephanie,


These can be pretty tricky to untangle. I have seen this happen when Update Sets have been manually updated and/or some of the changes that should have been in an Update Set were missed. Did this occur on an environment that was the target of an Update Set?



This is the way the different UI tables relate to each other. The direction of the arrows indicate a reference field pointing from one table to another. So, for example, there are two reference fields on sys_ui_form_section, one pointing to the sys_ui_form table and one pointing to the sys_ui_section table.


Screenshot 2017-04-17 17.50.26.png


The fix that you referenced in your original post was telling you how to fix the case where the link from sys_ui_form_section to sys_ui_section was corrupted with an invalid sys_id. It was recommending that you fix the link by pointing to a sys_ui_section record that truly exists. It sounds like that wasn't your problem.



The trick will be diagnosing what really is your problem. Here's what we need to figure out:


  1. Go to "System UI > Views" and open the Default view ("Name" = empty)
  2. Check in the Forms related list where table = <your custom table name>
  3. Make sure there is just one record, if so, open it
  4. Now from the Form form (ha ha), take a look at the "Form Sections" related list (this holds records from sys_ui_form_section)
  5. If you click the blue reference icon link it will take you to the "Form Section" (sys_ui_form_section) form
  6. If you click the underscored "Sys UI Section" link it will take you to the "Section" (sys_ui_section) form
  7. Make sure there is one and only one entry in the "Form Sections" related list for order = 0 and each number after that, one entry each for however many sections there are.
  8. Next open each "Form Section" link by clicking the blue reference icon from the "Form Sections" Related list. From the form that comes up, hover over the Section reference field, is it a valid link?
  9. If all the links in step #8 are valid then go back to Form form and open each of the "Sys UI Section" links. In the "Sys UI Section" form you will see a related list to the section elements that should be in the Section. Are they all there like you expect?


If you went through all these steps and everything seems to be correct, then log out, log back in and see if there is still a problem with the forms. If things still don't look right, try doing a cache clear.


steph3
Tera Contributor

Matthew,



Thank you for your detailed response with a diagram! I reverted to an older version of the view and made it look the way I want it to. However, when I looked at the Forms under System UI > Views I am seeing 2 forms for my table. One has an earlier date and looks to have the correct structure (3 sections - 2 of them named sections). The later date (it looks to be the same date and time as the revert) only has 2 sections and neither of them are named. I logged out and back in and did the cache clear.



This is an app that is still in development so it has not been pushed to any instance. Would it be beneficial to just recreate the form? Since it appears that the views are overlapping and disconnected somehow?



Thanks!


Mwatkins
ServiceNow Employee
ServiceNow Employee

I would remove the one that you don't want directly from the sys_ui_form table and remove any related records too. I would open all the related records first (sys_ui_form, sys_ui_form_section, sys_ui_element, sys_ui_section) and then delete them (I know some of them automatically delete by cascade behavior but can't remember which). That way you would be sure to delete all the unwanted records. Also, I would check your update sets to make sure that no remnants of the invalid forms are in there.