Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » How to filter by a parent field in a link1 transaction
Re: How to filter by a parent field in a link1 transaction [message #1502 is a reply to message #1501] Fri, 18 July 2008 05:05 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
That SELECT statement is being constructed from within 'part_equipo_xref', so it can only include automatic JOINs for relationships where 'part_equipo_xref' is the child.

If you wish to modify the SELECT statement which is constructed automatically then you need to follow the instructions at http://www.tonymarston.net/php-mysql/infrastructure-faq.html #faq84, as in the following example:
function _cm_pre_getData ($where, $where_array, $fieldarray=null)
{
    // construct default SELECT and FROM clauses using parent relations
    $this->sql_select  = null;
    $this->sql_from    = null;
    $this->sql_groupby = null;
    $this->sql_having  = null;
    $this->sql_from    = $this->_sqlForeignJoin($this->sql_select, $this->sql_from, $this->parent_relations);

    // add code to obtain facility_name
    $this->sql_select .= ', categoria.fecini, categoria.fecfin';
    $this->sql_from   .= ' LEFT JOIN categoria ON (categoria.categoria_id=equipo.categoria_id)';

    return $where;

} // _cm_pre_getData


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: override noedit on foreign field in multi2
Next Topic: How ro remove the 'page created in' message
Goto Forum:
  


Current Time: Mon Nov 25 01:41:37 EST 2024

Total time taken to generate the page: 0.01236 seconds