For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
$db = FabrikWorker::getDbo();
$query = $db->getQuery(true);
$query
->select('max(numero_di_pratica) +1')
->from($db->quoteName('movimenti'));
$db->setQuery($query);
$count = $db->loadResult();
return $count;
return '123';
Ok, and I dare guessing the list column "Numero Pratica" is the DB table named "numero_di_pratica", but in the context of this thread that's all I can see from here, and factually that's also only a wild guess.here is the screen of the list
With correct code in a calc element that's set to display in the list and at least one row existing: yes.yes but inserting the first record should give the number 1
So... sorry, but without sufficient information no one can help you from the distance.What are you getting, what are you seeing in the list?
Any errors? Also checked logs?
The column "numero_di_pratica" exists in the table named "movimenti"?
What exactly are you inserting in what I believe is the "Calculation" field in the calc element, and what are the other settings in that tab of the calc element? (Screenshot?)
What if you remove your code and, instead, simply and only insert
(You should have a column with values 123 in every row.)Code:return '123';
This would give you generally at least two options, depending on what exactly you need: either use the Ajax features of the calc element, or use a PHP form plugin.sorry but if I wanted to take the value of a field before saving the record to pass it to the query what is the syntax ..
I should insert a "where" with the value of a field inserted in input but still to be saved
sorry if I stress you
This latest note seems to call for your use of the PHP form plugin.I'm sorry again the calculation must be made only in insertion, I saw that it always increases even if I change other fields ..