01-12-2021, 09:44 PM
I spoke a bit too fast. This is strange:
It works with default fields but it does not work on when the condition is on custom fields. here is the error i get
aggregation('count','Quotes','pl_grand_total','[cf_1427,c,licitatie,or]')
So it says vtigerquotescf.cf_1427 is not known. But that field exists there. If i run the query in the engine it gives the same unknown column error. But the online demo seem to work ok, so i'm thinking it might be something with the engine?
I don't have a working log(from a good custom field query) so I can compare but here is a log from a aggregation with a standard field in condition - and this one works:
aggregation('count','Quotes','pl_grand_total','[description,c,licitatie,or]')
Could it be some version conflict?
PHP 7.4.11
Server version: 10.5.8-MariaDB-3
fresh git pull
It works with default fields but it does not work on when the condition is on custom fields. here is the error i get
aggregation('count','Quotes','pl_grand_total','[cf_1427,c,licitatie,or]')
Code:
DB >ADODB error Query Failed:select sum(vtiger_quotes.pl_grand_total) as aggop FROM vtiger_quotes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_quotes.quoteid LEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_quotes.accountid LEFT OUTER JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_quotes.potentialid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id WHERE vtiger_crmentity.deleted = 0 AND vtiger_account.accountid = 27418 and (vtiger_crmentity.deleted=0 AND (( vtiger_quotescf.cf_1427 LIKE '%licitatie%') ) AND vtiger_quotes.quoteid > 0)::->[1054]Unknown column 'vtiger_quotescf.cf_1427' in 'where clause'
So it says vtigerquotescf.cf_1427 is not known. But that field exists there. If i run the query in the engine it gives the same unknown column error. But the online demo seem to work ok, so i'm thinking it might be something with the engine?
I don't have a working log(from a good custom field query) so I can compare but here is a log from a aggregation with a standard field in condition - and this one works:
aggregation('count','Quotes','pl_grand_total','[description,c,licitatie,or]')
Code:
select sum(vtiger_quotes.pl_grand_total) as aggop FROM vtiger_quotes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_quotes.quoteid LEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_quotes.accountid LEFT OUTER JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_quotes.potentialid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id WHERE vtiger_crmentity.deleted = 0 AND vtiger_account.accountid = 27418 and (vtiger_crmentity.deleted=0 AND (( vtiger_crmentity.description LIKE '%licitatie%') ) AND vtiger_quotes.quoteid > 0)
Could it be some version conflict?
PHP 7.4.11
Server version: 10.5.8-MariaDB-3
fresh git pull