Questions
// Array Utils var firstArray= ['Green','Brown','Red','Orange','Yellow','Orange']; var secondArray=['Purple','Black','Green','Blue','Orange']; var thirdArray=['White','Orange','Green','pink']; var demoObject={name:'Bean Plant',color:'Green',vegetable:'Beans'}; var arrayUtil=new ArrayUtil(); // Merge two arrays gs.info(arrayUtil.concat(firstArray,secondArray)); // Check array contains the required value...
View Question[apcode language="php"] findReqElementCount(5); // In function we are passing the parameter as 5, which says that we have to count the item 5 occurrence in an array. function findReqElementCount(value){ var...
View Question[apcode language="php"] var firstArray=[5,5,3,5,8,5,9,5,4,5,9,5]; for(var i=0;i<=firstArray.length;i++){ if(firstArray.indexOf(5)!=-1){ firstArray.splice(firstArray.indexOf(5),1); } } gs.info(firstArray);
View QuestionGlideElement - nil() Determines if the field is null, applicable only to the elements of glideRecord object. Returns true if the field is null or an empty string, false To enable the for text search, you will need to enable the text index for the table. To do that, 1. Open Dictionary (sys_dictionary) table 2. Search for...
View Question"sn_itsm_va.com.snc.itsm.virtualagent.portal_url" property. Unfortunately, this is not dynamic as the VA is not able to get users session information. Steps to resolve the issue are as follows: Go to...
View Question(function runMailScript(current, template, email, email_action, event) { // Get Requested Item var reqitem = current.request_item; // Get Owned Variables for Requested Item and sort by Order var ownvar...
View QuestionCode to generates a virtual agent greeting message based on the time of day ServiceNow(Good Morning, Good Afternoon , Good Evening) (function execute() { var getime = new...
View QuestionScript Include : var WeekDay = Class.create(); WeekDay.prototype = Object.extendsObject(AbstractAjaxProcessor, { WorkDay: function() { var selected_date = this.getParameter("sysparm_date"); var d = new GlideDateTime(selected_date); var dayCount = d.getDayOfWeekLocalTime(); //...
View QuestionThe addExtraField() method allows you to query dot-walked fields in a single database request, rather than perform multiple queries per dot-walked element in a form or script var gliderecord =...
View Question