There is a JavaScript error in your browser console. In serviceportal i am getting the error.

SoumyasreeP
Tera Contributor
function onLoad() {
    var parentsysID = g_form.getParameter('sysparm_parent_sys_id');
    var parentTable = g_form.getParameter('sysparm_parent_table');

    if (parentsysID && parentTable == 'incident') {
        var ga = new GlideAjax("SetAffectedUser");
        ga.addParam('sysparm_name', 'getAffectedUser');
        ga.addParam('sysparm_inc_id', parentsysID);
        ga.getXMLAnswer(function(response) {
            if (response) {
                g_form.setValue('requested_for', response);
            }
        });
    }

}
8 REPLIES 8

Hi @SoumyasreeP 

 

Open browser console and copy the error and paste it here.

Google Chrome (recommended browser😞

  1. Open the website you want to check for errors.
  2. On your keyboard, press Ctrl + Shift + J (Windows) OR Cmd + Option + J (Mac).
  3. A panel will appear—this is the Developer Tools. Click on the “Console” tab at the top if it’s not already open.

Microsoft Edge:

  1. Visit the website you want to inspect.
  2. Press Ctrl + Shift + J (Windows).
  3. Click the “Console” tab if it's not already open. 

https://www.youtube.com/watch?v=oby8r4H4Gnk&t=146s

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
Mistakes... Whether they are small errors in judgement or epic failures we don't like to make them, but we can learn from them. Mistakes in software development usually produce errors at runtime that stop the code in its tracks or create output that leave us scratching our heads wondering what ...

I have already tried this after this also i am getting this error

Tanushree Maiti
Tera Patron

Also share what value you are getting it in response or share the script include.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

SoumyasreeP
Tera Contributor

The script include is-

var SetAffectedUser = Class.create();
SetAffectedUser.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    type: 'SetAffectedUser',
    getAffectedUser: function(){
        var incdentID = this.getParameter('sysparm_inc_id');
        var incGR = new GlideRecord('incident');
        if(incGR.get(incdentID)){
            return incGR.u_affected_user.toString();
        }
        return '';
    }
});