Where is this.newItem()

Priyanka132
Giga Contributor

Hi All,

Where is the funciton this.newItem() defined. I see this being used in several other script includes.

 

find_real_file.png

 

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hello,

It is a method within the AbstractAjaxProcessor script include and is used to create XML entries/nodes that are send as results to the client. This data is further fetched in the client side from the response of glide ajax calls.

    newItem: function(name) {
        if (!name)
            name = "item";

        var item = this.getDocument().createElement(name);
        this.getRootElement().appendChild(item);
        return item;
    },

 

Script include:  https://instance_name.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=d65f78c40a0a0b6900196656f35913d3

Replace your instance ame

View solution in original post

5 REPLIES 5

Alikutty A
Tera Sage

Hello,

It is a method within the AbstractAjaxProcessor script include and is used to create XML entries/nodes that are send as results to the client. This data is further fetched in the client side from the response of glide ajax calls.

    newItem: function(name) {
        if (!name)
            name = "item";

        var item = this.getDocument().createElement(name);
        this.getRootElement().appendChild(item);
        return item;
    },

 

Script include:  https://instance_name.service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=d65f78c40a0a0b6900196656f35913d3

Replace your instance ame

Hello AK,

 

Thats great... can you help me to know in which code is the below "s" used.

We have a requirement to prevent the knowledge article from being copied onto the incidents additional comments when "attach to incident" is clicked. I suspect that the additional comments in the incident gets its value from "s" but I am struggling to find which code does it.


So far I have found this community link to be very helpful : https://community.servicenow.com/community?id=community_question&sys_id=cb51c329db98dbc01dcaf3231f9619c3 

 

find_real_file.png

For this, you can navigate to the Incident Defection searcher under the cxs_table_config table, then navigate to the Search Action Configurations related list and open the entries that are named as Attach. On this record, clear out the value for Attach note field and it should achieve your requirment.

The actual table name is cxs_ui_action_config

find_real_file.png

Hi Priyanka,

There is a system property named glide.knowman.attach.fields which will determine in which field the details of attachment to be shown.

If you check this system property, you will see comments field is being present as default becuase of which you see the details filled in Additional comments once you click on Attach.

Mark the comment as a correct answer and helpfull if it helps.