sys_popup view not displaying all the fields

Pavan Kumar BV
Kilo Expert

Hi,

I have "sys_popup" view enabled on my incident table. However, I'm not able to see all the fields(in popupview) when i try to view the incident data from a custom field that i created on one of my application.

Below is my business scenario:

I have to perform ticket quality audit on my incidents, so i have designed a custom form and added a incident number reference field to it along with some other fields from incident table using dot-walking. So as soon as i select the INC number other fields of that INC gets auto populated. 

Now how can i include the Additional Comments and Worknotes here on my custom form?

Below are some steps i tried:

  1. Added the additional comments and worknotes fields with the help of dot-walking. But once i submit my Audit record an empty additional comment and work notes are getting added to the actual incident.The more times you perform audit on the same incident the more number of comments and work notes are getting added( this is happening even if the INC state is closed). 
  2. Tried to display the comments and worknotes in the the popup view instead of in the actual form. So i have moved the additional comments, worknotes section after the Description field. But, that is actually changing the view on incident form as well(Default view is also getting changed). I want this to happen only on my popup view not on the default view.

As you can see from my attachments, the popup view on my INC table has worknotes and additional comments(Notes section). But when i try to see the data from my custom form, it shows only till description field. Not the notes section.

Can anyone please help here. Thank you very much in advance. 

 

14 REPLIES 14

Hi Pavan,

can you try to move the position of those 2 fields at the top of incident form and check if they are shown

Sometimes it doesn't show fields which are at the bottom

BR you can have on your Audit Table

Condition: additional comments changes OR worknotes changes

Script:

var inc = new GlideRecord('incident');

inc.addQuery('sys_id', current.<incidentField>); // give here the field which stores inc

inc.query();

if(inc.next()){

if(current.comments !=''){
inc.comments = current.comments; // use field name here from audit table for comments
}

if(current.work_notes != ''){
inc.work_notes = current.work_notes; // use field name here from audit table for worknotes
}

inc.update();
}

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Sorry for the delayed response, didn't get a chance to check this issue. I have configured the BR on my Audit table but still the comments and worknotes are not getting populated. Below is my BR.

 

Before BRn condition is when INC number is not empty( as i need to populate the Comments and work notes after i select the inc number)

 

(function executeRule(current, previous /*null when async*/) {

    var inc = new GlideRecord('incident');

inc.addQuery('sys_id', current.incident_number); // give here the field which stores inc

inc.query();

if(inc.next()){

if(current.icrtemplate ==' ')

{
inc.comments_and_work_notes = current.icrtemplate; // used field name here from audit table for comments
}

inc.update();
}

})(current, previous);

Hi,

Did you check the BR is triggering?

Did you check the field name is correct "icrtemplate" ?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, Yes, i have checked the variable field. How do i check if the BR is triggering?

Hi Pavan,

try adding logs to check

gs.info('BR Triggered');

var inc = new GlideRecord('incident');

inc.addQuery('sys_id', current.<incidentField>); // give here the field which stores inc

inc.query();

if(inc.next()){

gs.info('Record found');

if(current.comments !=''){

gs.info('Comments not empty');

inc.comments = current.comments; // use field name here from audit table for comments
}

if(current.work_notes != ''){

gs.info('Work notes not empty');

inc.work_notes = current.work_notes; // use field name here from audit table for worknotes
}

inc.update();
}

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader