Hello friends,
I have a link field with an image that leads to a grid of customer’s orders. I’d like to show behind the link image the number of orders (and 0 if there aren’t any)
How could this be done?
Joe
Hello friends,
I have a link field with an image that leads to a grid of customer’s orders. I’d like to show behind the link image the number of orders (and 0 if there aren’t any)
How could this be done?
Joe
Why not just put the count above or below the image
Easier and neater imho
Thank you Kdriscoll, but what code do I need to generate the counting?
Joe
in onRecord (executed for each record loaded) run something like the following:
$sqlq =
"SELECT ".
" COUNT( * ) ".
"FROM ".
"tblCustomers ".
"INNER JOIN tblOrders ".
"ON tblCustomers.CustomerID = tblOrders.CustomerID ".
"WHERE ".
"tblOrders.CustomerID = " . {CustomerID} .";";
sc_lookup(my_data, $sqlq);
if ({my_data} === false) {
echo "<script type='text/javascript'>alert('Access error. Message = " . {my_data_erro} . "');</script>";
} elseif (empty({my_data})) {
{Num_of_Orders} = 0;
} else {
{Num_of_Orders} = {my_data[0][0]};
}
Thank you adz1111,
I will try that to fit it my application.
Joe