I need to add a record to a list and do the following,
1. Create a new row in another table
2. Grab the id of the row and parse it in the table of my current list.
I used the code listed below from the Wiki, but it doesn't work.
Error: syntax error, unexpected ';', expecting ',' or ')'
I put the code in a php plugin in the form and set "Start of form submission (onBeforeProcces)" on
Process script.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->insert('app_clients')->set('type = ' . $db->quote('lead'))
->set('name = ' . $db->quote('{app_assessment___name}');
$db->setQuery($query);
$db->execute();
$id = $db->insertid();
// Update form data with insert id
$formModel->updateFormData('app_assessment___client_id', $id);
Site: SSA
Form Name: Assessment
I need to create a row in "app_clients" table and return id to the current form in "{app_assessment___client_id}" field.
1. Create a new row in another table
2. Grab the id of the row and parse it in the table of my current list.
I used the code listed below from the Wiki, but it doesn't work.
Error: syntax error, unexpected ';', expecting ',' or ')'
I put the code in a php plugin in the form and set "Start of form submission (onBeforeProcces)" on
Process script.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->insert('app_clients')->set('type = ' . $db->quote('lead'))
->set('name = ' . $db->quote('{app_assessment___name}');
$db->setQuery($query);
$db->execute();
$id = $db->insertid();
// Update form data with insert id
$formModel->updateFormData('app_assessment___client_id', $id);
Site: SSA
Form Name: Assessment
I need to create a row in "app_clients" table and return id to the current form in "{app_assessment___client_id}" field.