Home » RADICORE » How To » How to make a list2 on a non existing child table
How to make a list2 on a non existing child table [message #1905] |
Tue, 09 December 2008 06:59  |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
I have a list1 of 'clients' and I want to make a list2 transaction that shows, for every selected client, the detail of an amount they have to pay.
The amount to pay is a union of different tables. I've created a class, extended the sql, defined the relationship etc.
What it's not working is that when I select a client from the list1 screen and click on the button of the list2 screen, the list 2 transaction shows all the clients, and for every client, the detail is not filtered, so for every client I see the detail of all the clients.
I can't seem to figure out where the problem is, any ideas? Is what I'm trying to achieve possible with Radicore?
|
|
|
|
|
|
Re: How to make a list2 on a non existing child table [message #1909 is a reply to message #1908] |
Tue, 09 December 2008 08:35   |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
The framework isn't corrupting the sql statement it's just that the function extractTableNames returns an incorrect value:'SELECT', and therefore the records aren't filtered.
This is the correct statement, the sql statement that I want to construct is:
SELECT entidad_id, concepto, sum(importe) as importe
FROM
(SELECT entidad.entidad_id ,'Esportistes' as concepto, 1 as importe
FROM participante
JOIN part_equipo_xref ON participante.participante_id=part_equipo_xref.participante_id
JOIN equipo ON part_equipo_xref.equipo_id = equipo.equipo_id
JOIN entidad ON equipo.entidad_id= entidad.entidad_id
JOIN temporada ON temporada.temporada_id = equipo.temporada_id
WHERE tippart='E'
SELECT entidad.entidad_id ,'Equips' , 1
FROM participante
JOIN equipo ON participante.participante_id = equipo.delegado_id
JOIN entidad ON equipo.entidad_id= entidad.entidad_id
JOIN temporada ON temporada.temporada_id = equipo.temporada_id
UNION ALL
SELECT entidad.entidad_id ,'Entitat', 1
FROM entidad) as entidad_s02
[Updated on: Tue, 09 December 2008 08:36] Report message to a moderator
|
|
|
|
Re: How to make a list2 on a non existing child table [message #1911 is a reply to message #1905] |
Tue, 09 December 2008 10:15   |
bonzo_bcn
Messages: 152 Registered: June 2008
|
Senior Member |
|
|
Thanks,I'm getting closer, so in my inner class table I have:
function _cm_pre_getData ($where, $where_array, $fieldarray=null){
$this->skip_getdata = true;
$this->fieldarray= $this->getData_raw($where);
return $where;
}
and it works great, for every parent it displays the correct child records.
The only problem now is that in the list1 screen, if I only select one parent and click on the list2 button, it retrieves all the parent records instead of retrieving only the selected one.
The generated .sql file has the correct sql statement though.
Do you know where the problem could be?
Thanks!
[Updated on: Tue, 09 December 2008 10:19] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Apr 10 14:26:30 EDT 2025
Total time taken to generate the page: 0.01531 seconds
|