Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

display message for related list

carlosrlara
Mega Expert

I would like to have a pop-up be displayed to an ITIL user when a Configuration Item Related List is present and active.

I have been reviewing and i can add an info message at the top but this can easily be ignored.

What i have come up with a simple alert message

What i have so far is a client script that i need to set for each table.

Presently, we use Server, Computer, and Network gear. When there is an active related list, i would want to display a message

function onLoad() {

    //Type appropriate comment here, and begin script below

   

  alert('Please Review any open CMDB Task Items');

}

1 ACCEPTED SOLUTION

venkatiyer1
Giga Guru

Hi Carlos,



Sorry my bad. Missed a closing parenthesis.



Should be fine now.



Regards,
Venkat




Code Below:




function onLoad() {


getGrandRows();



}


function getGrandRows() {


setTimeout(function(){


var list = GlideList2.get("x_snc_ci_validator_validation_task");


// You can get the ID of related list from the developer tool bar. Check for the div holding the content and grab the list id.


if(list && list != undefined) {



var numberOfCMDBItems   = list.grandTotalRows; // This parameter tells us number of rows in that list. Which should be greater than zero for alert


}


if(numberOfCMDBItems)


alert("'Please Review any open CMDB Task Items");



}, 3000);



}


View solution in original post

22 REPLIES 22

Venkat,



i get the following error



Could not save record because of a compile error: JavaScript parse error at line (16) column (2) problem = syntax error



which is the last two lines



}, 3000);



}


venkatiyer1
Giga Guru

Hi Carlos,



Sorry my bad. Missed a closing parenthesis.



Should be fine now.



Regards,
Venkat




Code Below:




function onLoad() {


getGrandRows();



}


function getGrandRows() {


setTimeout(function(){


var list = GlideList2.get("x_snc_ci_validator_validation_task");


// You can get the ID of related list from the developer tool bar. Check for the div holding the content and grab the list id.


if(list && list != undefined) {



var numberOfCMDBItems   = list.grandTotalRows; // This parameter tells us number of rows in that list. Which should be greater than zero for alert


}


if(numberOfCMDBItems)


alert("'Please Review any open CMDB Task Items");



}, 3000);



}


carlosrlara
Mega Expert

it still didnt work. i updated. I will revisit this soon.



Venkat , i truely appreciate the help.