Java Script Console error

shivani42
Tera Contributor

 

Hi All,

 

I have created a record producer where i am giving the SAM user to import multiple user allocation facility. I am using script section, adding the script which will create a transform map and load the data> transform the data to target table. But when i click on submit button, it is giving me  "There is a JavaScript error in your browser console" error. I am not able to understand why i am getting this error even there is no client script attaches to my record producer.

 

Script- 

var transformsysid = 'XXXXXXXXXXXX';
current.name = gs.getUserName() + " Import in User Allocation";
current.import_set_table_name = 'u_user_allocation_import';
current.file_retrieval_method = 'Attachment';
current.type = 'File';
current.format = 'Excel';
current.header_row = 1;
current.sheet_number = 1;
current.insert();

var loader = new GlideImportSetLoader();
var importsetrec = loader.getImportSetGr(current);
var ranload = loader.loadImportSetTable(importsetrec, current);
importsetrec.state = "loaded";
importsetrec.update();
//var setsysid = importsetrec.sys_id;
gs.addInfoMessage(importsetrec.sys_id);


var Transformworker = new GlideImportSetTransformerWorker(importsetrec.sys_id, transformsysid);
Transformworker.setBackground(true);
Transformworker.start();

current.setAbortAction(true);
 
Screnn Shot-
shivani42_0-1740654770551.png

 

Anyone has any idea?

Thanks,

Shivani

 
7 REPLIES 7

@shivani42 

did you identify the business rule?

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

shivani42
Tera Contributor

Hi,

 

I believe I have identified the problem. In my source table, the entitlement field had a maximum length of 40 characters, which was preventing the complete display name of the entitlement from being inserted. As a result, the system was unable to locate the entitlement in the target table. I resolved this issue by increasing the maximum length of the field to 100 characters, which allowed the full display name to be successfully inserted.

Do you have any insights into why I might be encountering a console error?

Thanks,

Shivani

@shivani42 

Very difficult to know what's causing that

You will have to debug it from your side as which UI policy or client script is causing that.

Also is that error coming on other catalog item as well?

Try removing everything from script and see if error comes or not

Is that error coming when you submit record from native?

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