Reporting: How to display the last record created

MStritt
Tera Guru

I'm trying to run a report off a table, and only want to display the most recent record created. For example below. I see that this report displays 126 records. I want to be able to display/show only the last record created. Or most recent record. What condition/s should I use, to give me the last record created.

find_real_file.png

 

1 ACCEPTED SOLUTION

 

Your Report Filter condition should be

sys_id = javascript: new jira().runReport() 

 

script include code with Client Callable Checkbox checked.

var jira = Class.create();
jira.prototype = {

runReport: function()

  {

 

  var gr = new GlideRecord("u_jira_projects");

  gr.orderByDesc("sys_created_on");

  gr.query();

  if (gr.next()) {

      return gr.getValue('sys_id');

  }

  },

      type: 'jira'

};

View solution in original post

10 REPLIES 10

MStritt
Tera Guru

Got it working. Thanks guys!

 

Mike