Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Limitation on extending Task table

xiaix
Tera Guru

So I heard that in any given instance, we're allowed a maximum of 1000 columns that extend the task table.   I also heard that in order to find out how many you're currently at, you need to submit a ticket to HI and ask them.

I wrote this script, which I believe, should provide the answer:

var gr = new GlideRecord('sys_db_object');

gr.addQuery('super_class', '29c117436f0111007906db3bbb3ee4f4'); // sys_id of Task table

gr.query();

var tables = 0;

var columns = 0;

while(gr.next())

{

      tables++;      

      var gr2 = new GlideRecord('sys_dictionary');

      gr2.addQuery('name', gr.name);

      gr2.query();

      while (gr2.next())

      {

              if (gr2.element.indexOf("u_") == 0)

                      columns++;

      }    

}

console.debug("Tables: " + tables);

console.debug("Columns: " + columns);

I personally get:

        Tables: 38

        Columns: 230

Can someone confirm whether my code is accurate or if I'm missing something?

2 REPLIES 2

Mike Allen
Mega Sage

Looks good.   Just a suggestion on how to make this a little cleaner, check out TableUtils:



TableUtils - ServiceNow Wiki



Specifically the getTableExtensions() method.


Ha, nice!   Never knew about TableUtils().