Forum Discussion

JacobJacob's avatar
JacobJacob
Qrew Cadet
8 years ago

Javascript alert on report with 0 records

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._
  • Inside a report you can see the total  records number 

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

    => 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.