AOR: Custom fields can only be used when "normal" fields used before #941

Open
opened 2026-02-20 15:03:08 -05:00 by deekerman · 6 comments
Owner

Originally created by @gunnicom on GitHub (Jun 21, 2016).

If you create a report and want to display a custom field from a module thats related, you can only report this field if another "normal" field from the module is used before the custom field.
If the sequence is different ("normal" field after custom field ) you get an error in the suitecrm.log like:

Tue Jun 21 11:47:06 2016 [70849][1][FATAL] Query Failed: SELECT SUM(opportunities_cstm.leistung_c) AS 'Leistung_[kW]0', opportunities:assigned_user_link_cstm.team_c AS 'team1', opportunities:assigned_user_link.sugar_login AS 'Is_SuiteCRM_User2', opportunities:assigned_user_link_cstm.team_c AS 'team3' FROM opportunities LEFT JOIN opportunities_cstm opportunities_cstm ON opportunities.id = opportunities_cstm.id_c LEFT JOIN users opportunities:assigned_user_link ON opportunities.assigned_user_id=opportunities:assigned_user_link.id AND opportunities:assigned_user_link.deleted=0

LEFT JOIN assigned_user_link_cstm opportunities:assigned_user_link_cstm ON opportunities:assigned_user_link.id = opportunities:assigned_user_link_cstm.id_c WHERE ( opportunities.sales_stage = 'Closed Won' AND opportunities.opportunity_type != 'Existing Business' AND opportunities.date_closed BETWEEN "2016-06-01 00:00:00" AND "2016-07-01 00:00:00" AND opportunities_cstm.leistung_c > '0' ) AND opportunities.deleted = 0 GROUP BY opportunities:assigned_user_link_cstm.team_c, opportunities:assigned_user_link_cstm.team_c, opportunities:assigned_user_link.sugar_login LIMIT 0,20: MySQL error 1146: Table 'suitecrm_de.assigned_user_link_cstm' doesn't exist

Originally created by @gunnicom on GitHub (Jun 21, 2016). If you create a report and want to display a custom field from a module thats related, you can only report this field if another "normal" field from the module is used before the custom field. If the sequence is different ("normal" field after custom field ) you get an error in the suitecrm.log like: Tue Jun 21 11:47:06 2016 [70849][1][FATAL] Query Failed: SELECT SUM(`opportunities_cstm`.leistung_c) AS 'Leistung_[kW]0', `opportunities:assigned_user_link_cstm`.team_c AS 'team1', `opportunities:assigned_user_link`.sugar_login AS 'Is_SuiteCRM_User2', `opportunities:assigned_user_link_cstm`.team_c AS 'team3' FROM `opportunities` LEFT JOIN `opportunities_cstm` `opportunities_cstm` ON `opportunities`.id = `opportunities_cstm`.id_c LEFT JOIN users `opportunities:assigned_user_link` ON `opportunities`.assigned_user_id=`opportunities:assigned_user_link`.id AND `opportunities:assigned_user_link`.deleted=0 LEFT JOIN `assigned_user_link_cstm` `opportunities:assigned_user_link_cstm` ON `opportunities:assigned_user_link`.id = `opportunities:assigned_user_link_cstm`.id_c WHERE ( `opportunities`.sales_stage = 'Closed Won' AND `opportunities`.opportunity_type != 'Existing Business' AND `opportunities`.date_closed BETWEEN "2016-06-01 00:00:00" AND "2016-07-01 00:00:00" AND `opportunities_cstm`.leistung_c > '0' ) AND opportunities.deleted = 0 GROUP BY `opportunities:assigned_user_link_cstm`.team_c, `opportunities:assigned_user_link_cstm`.team_c, `opportunities:assigned_user_link`.sugar_login LIMIT 0,20: MySQL error 1146: Table 'suitecrm_de.assigned_user_link_cstm' doesn't exist
Author
Owner

@shogunpol commented on GitHub (Aug 19, 2016):

@gunnicom I am unable to replicate this in the latest version of SuiteCRM(7.7.1), can you confirm is that issue is solved in your instance.

@shogunpol commented on GitHub (Aug 19, 2016): @gunnicom I am unable to replicate this in the latest version of SuiteCRM(7.7.1), can you confirm is that issue is solved in your instance.
Author
Owner

@gunnicom commented on GitHub (Aug 30, 2016):

Bug still exists in Suite 7.7.3

@gunnicom commented on GitHub (Aug 30, 2016): Bug still exists in Suite 7.7.3
Author
Owner

@gunnicom commented on GitHub (Aug 30, 2016):

To replicate:
Custom fields added via Studio:
team in Users, label "Team"
leistung in Opportunities, label "Leistung [kW]"

Report: Field leistung as SUM, field team group_by over assigned_user

Error in log:

Tue Aug 30 11:48:07 2016 [124854][1][FATAL] Query Failed: SELECT count(*) c FROM (SELECT SUM(opportunities_cstm.leistung_c) AS 'Leistung_[kW]0', opportunities:assigned_user_link_cstm.team_c AS 'team1', opportunities.id AS opportunities_id FROM opportunities LEFT JOIN opportunities_cstm opportunities_cstm ON opportunities.id = opportunities_cstm.id_c LEFT JOIN users opportunities:assigned_user_link ON opportunities.assigned_user_id=opportunities:assigned_user_link.id AND opportunities:assigned_user_link.deleted=0

LEFT JOIN assigned_user_link_cstm opportunities:assigned_user_link_cstm ON opportunities:assigned_user_link.id = opportunities:assigned_user_link_cstm.id_c WHERE opportunities.deleted = 0 GROUP BY opportunities:assigned_user_link_cstm.team_c) as n: MySQL error 1146: Table 'suitecrm_de.assigned_user_link_cstm' doesn't exist

When i now add the username from the assigned_user before the team_c field it shows a list.
If this field is after the team_c field the error occurs again.

@gunnicom commented on GitHub (Aug 30, 2016): To replicate: Custom fields added via Studio: team in Users, label "Team" leistung in Opportunities, label "Leistung [kW]" Report: Field leistung as SUM, field team group_by over assigned_user Error in log: Tue Aug 30 11:48:07 2016 [124854][1][FATAL] Query Failed: SELECT count(*) c FROM (SELECT SUM(`opportunities_cstm`.leistung_c) AS 'Leistung_[kW]0', `opportunities:assigned_user_link_cstm`.team_c AS 'team1', `opportunities`.id AS opportunities_id FROM `opportunities` LEFT JOIN `opportunities_cstm` `opportunities_cstm` ON `opportunities`.id = `opportunities_cstm`.id_c LEFT JOIN users `opportunities:assigned_user_link` ON `opportunities`.assigned_user_id=`opportunities:assigned_user_link`.id AND `opportunities:assigned_user_link`.deleted=0 LEFT JOIN `assigned_user_link_cstm` `opportunities:assigned_user_link_cstm` ON `opportunities:assigned_user_link`.id = `opportunities:assigned_user_link_cstm`.id_c WHERE opportunities.deleted = 0 GROUP BY `opportunities:assigned_user_link_cstm`.team_c) as n: MySQL error 1146: Table 'suitecrm_de.assigned_user_link_cstm' doesn't exist When i now add the username from the assigned_user before the team_c field it shows a list. If this field is after the team_c field the error occurs again.
Author
Owner

@shogunpol commented on GitHub (Aug 30, 2016):

The issue has been tested on recent version of SuiteCRM(7.7.3), and it appear, i assign the bug label.
@gunnicom , thanks for raise this issue.

@shogunpol commented on GitHub (Aug 30, 2016): The issue has been tested on recent version of SuiteCRM(7.7.3), and it appear, i assign the bug label. @gunnicom , thanks for raise this issue.
Author
Owner

@jbrveen commented on GitHub (Jan 3, 2020):

Please reopen. In 7.11.10 this bug reappears.

@jbrveen commented on GitHub (Jan 3, 2020): Please reopen. In 7.11.10 this bug reappears.
Author
Owner

@pgorod commented on GitHub (Jan 6, 2020):

Which one(s) from #1635, #8334, #8404 is it better to keep open? Probably not all of them are needed.

@pgorod commented on GitHub (Jan 6, 2020): Which one(s) from #1635, #8334, #8404 is it better to keep open? Probably not all of them are needed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#941
No description provided.