Javascript alert on report with 0 records

  • 1
  • 2
  • Question
  • Updated 2 years ago
  • In Progress
I have an ask the user report where they put in a date and pull up records related to it.  I was wondering if there is a way for an alert or a message appear once the date has been selected if no records are returned.  Basically can this be done with a code page to a report or is there a way through native processes.
Photo of Jacob

Jacob

  • 738 Points 500 badge 2x thumb
  • Interested

Posted 2 years ago

  • 1
  • 2
Photo of John Thomas

John Thomas

  • 1,062 Points 1k badge 2x thumb
Inside a report you can see the total  records number 

$("table[qbdbid=[tableId]] tr:first").text();

[tableId] => should be your table id , remove the square brackets

once you get the string , you can search for the string "no results". if the string consist of  "no results" make a if loop and give as an alert there are no records.

I Think this will solve your problem.