Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Form Controller Event handler with Script, page is not loading

SundaramR
Tera Guru

Hi,

 

In my Xanadu Scoped Next Experience application I have page with Form and Form Controller. On the Form controller set value event, If I add the script to set the value. Page is not loading in the browser. If I remove the script form is loading as expected.  Not sure why when switch to script, page stop loading.

 

/**
 * @Param {params} params
 * @Param {api} params.api
 * @Param {any} params.event
 */
function evaluateEvent({
    api,
    event
}) {

    try {
        var filedName = "short_description";
        var value = "test";
        var displayValue = "test";
        return {
            fieldName: filedName,
            value: value,
            displayValue: displayValue
        };

    } catch (ex) {
        console.log("Error: " + ex);
    }
}

 

adding the above code. looking for some help to fix this issue. 

0 REPLIES 0