Debugger stops after gr.newRecord() in Script Include (Xanadu/Yokohama)

AlexAlvarez
Tera Contributor

Hi everyone,

 

I’ve encountered an issue while debugging Script Includes in recent ServiceNow releases (tested on Xanadu and Yokohama). Specifically, when I place a breakpoint on or after a gr.newRecord() call, the debugger is unable to step over or proceed to the next line. The execution appears to continue correctly behind the scenes, but from the debugger’s perspective, it’s stuck or silently skips the following lines.

 

I’ve tested this behavior across multiple instances and it seems consistent, which makes me wonder:

 

  • Has anyone else experienced this behavior when using newRecord() in a Script Include?

  • Do you know if this is a known limitation, intentional behavior, or a bug?

  • Is there an open HI ticket or internal bug report that tracks this?

 

Any insights or workarounds would be greatly appreciated. Thanks in advance!

 

Code tested:

// Script include

var demo = Class.create();
demo.prototype = {
    initialize: function() {
    },

	createRecord: function () {
		var incident = new GlideRecord("incident");
		incident.newRecord();
		incident.short_description = 'Test';
	},

    type: 'demo'
};


// Background script
var sc = new global.demo();
sc.createRecord();
Alex Álvarez
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@AlexAlvarez 

are you saying it's not setting the incident short_description field?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

No. I said:

Specifically, when I place a breakpoint on or after a gr.newRecord() call, the debugger is unable to step over or proceed to the next line. The execution appears to continue correctly behind the scenes, but from the debugger’s perspective, it’s stuck or silently skips the following lines.

Alex Álvarez

@AlexAlvarez 

seems a known thing.

check this link

Script Debugger exits when stepping over GlideRecord.insert 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader