The CreatorCon Call for Content is officially open! Get started here.

How do I prevent a parent table from showing its extended tables data

jhuston
Mega Contributor

I created a custom app by extending the incident table.   (<-- This may have been a bad idea, in fact I'm pretty sure it was).   Its has all the fields I need and some that the task table didn't have.   Fields that we built out in incident when we first got our instance.

So I have this app, and I have imported 1000's of records into it that are sensitive, so I lock them down to a specific role.   That works fine, but when I pull up my list of all incidents as an ITIL user, say sorted by created date.   It will filter out extended tables records with security constraints.   I guess I get that, but isn't there a way to extend a table without messing up the data in the app in which the parent was created for in the first place.

If not, I'm guessing I should have just created my own table in the beginning or extended the task table>

Thanks for you help

Side note:   I pretty much based the decision on the article below

2.1.2 Know When to Extend a Base Table

Extending a base table incorporates all the fields of the original table and creates new fields for the new table. This inheritance is used to create major subcategories of data. In general, when you create a new table, it should extend a base table if:

  • The fields or attributes of an existing table are similar to the ones you want to use.
  • The scripts for an existing table are useful for the application.
  • The information contained in the new table is essential to the process that will use the table. For example, if the process is task based, extending the Task [task] table may be a better option than creating a new table with many of the same fields. Similarly, if the process involves an asset (that is, a CI), extending one of the CMDB tables may be a better solution than creating a new table, as long as you extend a table that contains the majority of the fields you require.
8 REPLIES 8

The SN Nerd
Giga Sage
Giga Sage

If you created this application in Fuji and your table is tied to that application, all is not lost!


You can make the table only visible from inside your application, so it won't show in the Incident List in the global scope.



Right click on a list of your records and navigate to "Configure > Table" and go to the "Application Access" tab.


Set 'Accessible from' to "This application scope only". Your records should no longer show up in the parent incident list.



As an example, you can create an Application that extends task and perform that above steps to prevent it from showing in task lists.



If this is not fit for purpose you'll have to add a reference qualifier to every single Incident module in the system.



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

jhuston
Mega Contributor

Thanks to both of your for your response. I think both would how worked, but I ended up using this background script to change the extended table from incident to task.   I then opened up the accessibility.


Thanks again


var table = '<source_table>';


var old_parent = '';


var new_parent = '<table_extension>';



var changer = new GlideTableParentChange(table);


changer.change(old_parent, new_parent);


antin_s
ServiceNow Employee
ServiceNow Employee

Hi John,



You would still face the issue when you try to see the records in Task table. So, the recommendation is to create a Before Query Business Rule and apply the condition in it.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


Hello John,



I agree with Antin here Before query business rule is your best bet here. Please refer the below blog for more info on before query business rule.


https://www.servicenowguru.com/scripting/business-rules-scripting/controlling-record-access-before-q...