Implications of Extending a Table in a Scoped Application

shawnclune
ServiceNow Employee
ServiceNow Employee

What are the implications -- IF ANY -- of extending a table that is part of a scoped application?

  • Does it matter if the "newly created table" is in Global or part of a new scoped application?
  • Are there "upstream / downstream" consequences for the "newly created table" that one should be aware of?
  • Are there any issues to be aware of with respect to future upgrades?

Thank you everyone for your feedback.

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi Shawn,



I do this all the time (several times yesterday.) Let's take the example of extending Task to a scoped app (we'll call it x_scope_task for clarity.) Of course, you inherit all the fields, business rules, client scripts, etc. that task has in to the scoped app.



  • If you add fields, they are private to x_scope_task as you would expect. You are not force to prefix the fields with u_ as you are in global because these are your tables and your fields so there is no chance of conflict with a ServiceNow field. As a word of caution, avoid naming your fields with OOB objects, methods or classes (e.g. don't call your field current, event, previous, email, query, next, etc.) When in doubt, put your own u_ prefix or some other thing to make it different.)
  • You can add fields to pre-existing tables like cmdb_ci and they will be prefixed with the scope. E.g. cmdb_ci.x_scope_newfield.
  • If you want to adjust labels, you cannot use right-click Configure Label, but rather right-click Configure Dictionary, and add to the Label related list below.
  • Dictionary overrides work as expected for display values, reference qualifiers, etc.
  • As far as upgrades, no issues that I have seen and I've been through a few since scoping was introduced in Fuji.


Hope that helps. FYI - section 2.1.2 in this doc is a good bit of knowledge also.


http://wiki.servicenow.com/index.php?title=Modifying_the_Application_Design


Chuck,



Thank you for the reply.



SPECIFIC SCENARIO:


I think I'm following you, but let me use a different table than the TASK table since it's in the Global scope ...


  • Let's pick the RISK table (sn_risk_risk) which is extended from the ITEM table.  
  • The RISK table is in a Scoped Application called "Risk."  
  • The RISK table itself is not extensible by default, but you decide to modify that so you can extend it.


Do you see any issues extending a new table from the RISK table and having the new table in a completely different scope, (e.g., Global or Timbuktu)?



Regards.


HI Shawn,



In order to extend the sn_risk_risk table, you will need to change to the Risk scope and update the table definition to make sn_risk_risk extensible.



Doing so carries the same warning as modifying any other OOB object, once you modify it, you own it (save changing an Active flag.) Any further updates to the table definition itself (not necessarily the fields, ACLs, etc) are not updated.



If you do check the Extensible checkbox on the table, you will then be able to use it in your scoped app to extend sn_risk_risk to your table.


To add, When you modify any OOTB object a corresponding record is added in the Customer Update [sys_update_xml] table and the Replace on upgrade field is set to false.


Select the Replace on upgrade check box   on the record to true and click Update. The customized object will be replaced on the next upgrade.