Service Portal Service Catalog script errors

VJ4
Giga Expert

Hello guys,

I'm getting four errors when using forms in ServiceCatalog in SP (Helsinki - Patch 6).

The errors are;

Server JavaScript error Cannot convert null to an object.

Line number 25

Script source code logged to browser console

Failing widget:

And the below in the SN logs.

java.lang.NullPointerException: java.lang.NullPointerException: com.glide.data_lookup.catalog.CatalogDataLookup.getDefinitionsWithClientScriptForItem(CatalogDataLookup.java:59)

com.glide.ui.ng.catalog.NGCatalogDataLookupProcessor.getCatalogLookupsForItem(NGCatalogDataLookupProcessor.java:67)

com.glide.ui.ng.catalog.NGCatalogDataLookupProcessor.getCatalogDataLookups(NGCatalogDataLookupProcessor.java:60)

com.glide.ui.ng.catalog.NGCatalogDataLookupProcessor.process0(NGCatalogDataLookupProcessor.java:35)

com.glide.ui.ng.catalog.NGCatalogProcessorBase.process(NGCatalogProcessorBase.java:29)

com.glide.ui.ng.AngularProcessor.process(AngularProcessor.java:115)

com.glide.processors.AProcessor.runProcessor(AProcessor.java:412)

com.glide.processors.AProcessor.processTransaction(AProcessor.java:187)

com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:165)

com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:49)

com.glide.sys.ServletTransaction.run(ServletTransaction.java:34)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

java.lang.Thread.run(Thread.java:745)

I read few threads about this issue and changed the Catalog Client Script UI Type to 'Both' but no joy.

Has anyone found a solution to this at all?

Thanks in advance.

9 REPLIES 9

bianca_vaccarin
ServiceNow Employee
ServiceNow Employee

Hmm maybe bharath.padaki@servicenow.com who wrote Service Catalog on Service Portal   can help you out. Or rohantyagi any idea?


Hi Bianca,



We managed to fix this error sometime back but forgot to mark this thread as resolved. Thanks for the article link.



VJ


bianca_vaccarin
ServiceNow Employee
ServiceNow Employee

Oh how did you solve it? Please share it with us it could help future users who run into this message too.


Even i am using Helsinki and i am not able to fix with any workarround.


Hiya,



The issue we had with our instance was due to a limitation in the My Request widget,if I remember correctly. Please note that this was in the Helsinki release so not sure if it's been addressed now. We were getting errors for service catalog items that were not associated with a RITM so had to modify the Server Script like below.



while (gr.next()) {


if (recordIdx == options.maximum_entries)


break;



var record = {};


record.sys_id = gr.getValue('sys_id');


var ritm = new GlideRecord("sc_req_item");


ritm.addQuery("request", gr.getUniqueValue());


ritm.query();



if (ritm.getRowCount() == 0){


//continue;


record.display_field = gr.getDisplayValue("short_description");


}



else if (ritm.getRowCount() > 1){


record.display_field = gs.getMessage("{0} requested items", ritm.getRowCount());


}



else {


ritm.next();


record.display_field = ritm.cat_item.getDisplayValue() || ritm.getDisplayValue("short_description");


}



record.secondary_fields = [];


data.secondary_fields.forEach(function(f) {


record.secondary_fields.push(getField(gr, f));


});



record.url = {id: 'sc_request', table: 'sc_request', sys_id: record.sys_id};


data.list.push(record);


recordIdx++;


}