• Fabrik4.5.1 for Joomla5.2.4

    Fabrik4.5.1 is out. This update is needed for J!5.2.4

    See Announcements

Custom edit URL question

ayito

New Member
Hello,

I am trying to do the following:

I have two list (A, B) with two forms (A, B)

I am showing list A to the public.

When someone clicks on a row in list A I would like to open form B to input new record in list B.

I also want to pass values of two elements from row in list A to the new record opened. So elements X and Y of rowid 1 of list A will be preloaded in new elements Z and W of new record in form B.

I am trying custom edit URL in list A, and it opens the form B, but not a new record, it opens to edit the data in list B that has the same rowid that the row clicked in list A.

so if I click in list A rowid=1 it opens me form B (to edit list B) with the data of list B rowid=1.

This is the custom edit URL

index.php?option=com_fabrik&view=form&formid=1

I haven't tried yet to pass the values of elements in list A to the form fields in form B since I am still stuck with this.

Anyone knows the workaround for this??

By the way, this is my first post, I've search the forum and wiki for a solution to this, If I have missed, please redirect me to it. And of course, fabrik is great (so far), good work!!!
 
Since I am not getting to know how to work with custom URL, I know have thought of using the php Plug-in, I have come so far with this script that opens form B when I click in the button in list A.

This is the script:

<?php
/* Redirect to form B from list A */


$num_ins = ;
$your_url1 = "index.php?option=com_fabrik&view=form&formid=1&rowid=0&tvu7g_fb_contact_sample___message=";
$your_url = $your_url1.$num_ins;
$app =&JFactory::getApplication();
$app->redirect( JRoute::_($your_url), $your_sms);
?>

So what I want is now to pass some elements from rowid in list A to some of the fields in form B.

I think I have to store the element value un $num_ins and concatenate $your_url1 with $nums_ins then pass this as the url.

I am stuck here, how can I store in php one element in a variable. Do I have to read it from the database?? or are they store elsewhere, like rowid in custom links. I have tried with the frabrik conten plugin, but not getting the result I wanted.
 
Solution with php-plugin in list A.

<?php
/* Code to place in php-plugin in a list A so when a user clicks button it opens a new form B and preloads one
element of list A into a destination field in form B (associated with list B) */
$db = JFactory::getDBO();
$id_array = JRequest::getVar('ids', array());
$id = reset($id_array);$db =&JFactory::getDBO();

$sql = "SELECT Numero_de_Inscripcion FROM `inbio_colaboradores` WHERE id=\"$id\" limit 1";
$db->setQuery($sql);
$result = $db-> loadResult();

$your_url1 = "index.php?option=com_fabrik&view=form&formid=1&rowid=0&tvu7g_fb_contact_sample___message=";
$your_url = $your_url1.$result;
$app =&JFactory::getApplication();
$app->redirect( JRoute::_($your_url), $your_sms);
?>
 
Back
Top