switchFdScope error in browser console when loading forms
search cancel

switchFdScope error in browser console when loading forms

book

Article ID: 408982

calendar_today

Updated On:

Products

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

Issue/Introduction

The following error appears in the F12 Developer tool Console tab when loading a Service Catalog form in Service Point:

eval at switchFdScope

This occurs when using the setTimeout in an onLoad function in the form script:

 setTimeout(function () { ca_fd.js.testFunction() }, 100);

Environment

Service Point 17.4

Service Catalog 17.4

Cause

if there is an async call on onload of the form and if there are multiple forms attached to single service option, we should set the scope back to the original form. We should store the scope and formid and switch the scope when we are trying to access the function on callback method.

Resolution

1. Use the following logic to call the function in the Catalog form script:

var formId = ca_fd.formId;
var scope = ca_fd.fdScope;
setTimeout(function () { ca_fd.switchFdScope(scope,formId);ca_fd.js.testFunction() }, 100);

2. Save Changes

3. Remove cache from browser and close all windows

4. Log into Service Point and load the offering/form.