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.
var url = "index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=customPDF&listid=" + id;
class UserAjax
{
function customPDF()
{
$app = JFactory::getApplication();
$listid = $app->input->getInt('listid');
$model = JModel::getInstance('List', 'FabrikFEModel');
$model->setId($listid);
// This should be the list query containing any applied filters
$sql = $model->buildQuery();
// The list's connection's db
$db = $model->getDb();
// Do you custom code here.............
}
}