How to return repeating group row id in main form page for calcualation

dealio

Member
I have a form and on that form is repeat group. I'm trying to return the id of the records it the repeat group to use in an sql query.



In a calculated field I have something like this:

=================================================
$getRowId= '{rowid}'; //xoms_mgls___id





$subGroupRowId= '{Child Row Id}'; <--- how to return the child group ID
//xoms_order_basins___mgl_getid[] <-- child element


$db = JFactory::getDbo();
$options = array();
$query = $db->getQuery(true);
$query
->select(array('a.id', 'a.order_id', 'b.id', 'b.order_id'))
->from($db->quoteName('xoms_order_basins', 'a'))
->join('INNER', $db->quoteName('xoms_order_basins', 'b') . ' ON (' . $db->quoteName('b.id') . ' = ' . $db->quoteName('a.id') . ')')

->where('a.id = ' . (int) $subGroupRowId);

$db->setQuery($query);

$rows = $db -> loadObjectList();

foreach ($rows as $orderid) {
$getorderid= $orderid->order_id;
}

return $getorderid ;
=================================================



Thanks!
 
Do a pretty dump at the start of your calc and you will probably see what you need. You'll see a few different formats that you can use for your processing.

PHP:
echo '<pre>'; print_r($data); echo '</pre>';

Fabrik normally creates an extra table for repeated data. If you main table is xoms_order_basins then you'll probably find a xoms_order_basins_XX_repeat table using something like phpmyadmin. The XX stands for your group ID.

You can use placeholders as well so something like

PHP:
$options =  '{xoms_order_basins_XX_repeat}';
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top