g_tabs2Sections is not defined

davilu
Mega Sage

Our team is trying to use g_tabs2Sections.deactivate() in an onLoad client script, but keep getting a console error saying g_tabs2Sectionsis not defined.  We tried adding global in front and even cloned the client script in the global scope to see if that would work, but still getting the same error.

Our onLoad client script looks like this:

var sections = g_form.getSectionNames();

for(var i=0; i<sections.length; i++){
  if(sections[i] != 'position_data'){
    g_tabs2Sections.deactivate();
  }
}

Any suggestions?  Thanks!

2 REPLIES 2

Shane41
ServiceNow Employee
ServiceNow Employee

Hi Davilu,

I have tested your script in my instance and it works

What table are you trying to run this script on?

Are you trying to use this on a scoped table?

Kind Regards,

Shane

Thanks Shane!  I think I misunderstood what that does.  I thought it deactivated that entire section, not disable tabbed UI.  Thanks for looking into it.