We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Custom Date Interactive Filter Shows Results but does not list them

Jbelter
Tera Guru

Hi all,

Here is a screenshot of what I am noticing

Screenshot 2024-01-22 152911.png

As you can tell, there are 4 results but nothing is shown.

Here is the interactive filter business rule line that I added:

answer.add('096_2 years from now@javascript:new global.YearsFromNow().start(2)@javascript:new global.YearsFromNow().start(2)', gs.getMessage('2 years from now'));

Here is the script include it is calling:

 

Screenshot 2024-01-22 153012.png

var YearsFromNow = Class.create();
YearsFromNow.prototype = Object.extendsObject(AbstractAjaxProcessor, {
	today: new GlideDate(),
	
	start: function(num) {
		var start = this.today;
		start.setYearLocalTime(start.getYear()+num);
		start.setMonthLocalTime(1);
		start.setDayOfMonthLocalTime(1);
		return(start.toString()+" 06:00:00");
	},
	
	end: function(num) {
		var end = this.today;
		end.setYearLocalTime(end.getYear()+num);
		end.setMonthLocalTime(1);
		end.setDayOfMonthLocalTime(1);
		return(end.toString()+" 05:59:59");
	},
	
    type: 'YearsFromNow'
});

This returns a date in string format.

 

Please let me know if you have any ideas!

0 REPLIES 0