"Error while invoking onload function" in Service point when calling function defined in custom_form_lib.js

book

Article ID: 198830

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager CA Service Catalog

Issue/Introduction

A function has been defined in custom_form_lib.js which is called in the onLoad event from some forms. This works fine in Catalog. However, it does not work when loading the form in Service Point.

Function:

function to_loadl(form_actual){
   rstat =_.request.status;

...

This works fine when moving the function from custom_form_lib.js to the form

Cause

This is by design.

Environment

Release : 17.2

Component : XFLOW INTERFACE FOR SDM

Resolution

The variable _ is not directly accessible in the Service Point. To get access to this variable we might need to modify the function in custom_form_lib.js function as shown below:

Eg:

function to_loadl(form_actual){
   rstat =_.request.status;
//..............

}



to

function to_load(form_actual){

var _ = ca_fd.getContext();
rstat =_.request.status;
//..............

}



Before accessing the variable we need to assign this using the method ca_fd.getContext(); which will get context variable to be used in Widgets or ServicePoint.


It is advisable not to have computationally intensive functions that might slow down Form Loading.