Where are the queries?

sugarcrmdevelopers —  March 7, 2013
Hey developers, some non-developers, have you ever thought of where the heck the queries are of List View and Sub panels?

Let me give you the file names and function names.

List View:

  • Go to include/ListView/ListViewData.php  
  • Search for function getListViewData 
  • Scroll down until you see $main_query = $ret_array[‘select’] . $params[‘custom_select’] . $ret_array[‘from’]
  • Right below that you can print the query for List View.

Sub Panel:

  • Go to data/SugarBean.php 
  • Search for function get_union_related_list 
  • Go to the end of the function and before it returns the result echo $final_query to see the queries of subpanels.

Hope you find this post useful.

Feel free to post your comments.