How to create a new report operator?

I need to create a new operator in Sugar, is that possible??

Parents
  • As Andre suggested, there is no upgrade safe route, and mostly it's not a good idea to spend time customizing it.

    But - if you really realllyy need it - there is an non-upgrade safe route and I can give a few suggestions on how we did it, which is not as easy or straightforward as other Sugar customizations.

    1. The main file in the UI that you're looking for is include/javascript/reports.js -

    • Look for addFilterQualify function - this is where the operators are added.
    • You may also want to modify addFilterInput to define how it's displayed.
    • And as part of saveFilters, generate the filter definition that you need from the fields.

    2. Implement the query generation part for your filter in modules/Reports/Report.php - look out for register_field_for_query or filtersIterate functions.

Reply
  • As Andre suggested, there is no upgrade safe route, and mostly it's not a good idea to spend time customizing it.

    But - if you really realllyy need it - there is an non-upgrade safe route and I can give a few suggestions on how we did it, which is not as easy or straightforward as other Sugar customizations.

    1. The main file in the UI that you're looking for is include/javascript/reports.js -

    • Look for addFilterQualify function - this is where the operators are added.
    • You may also want to modify addFilterInput to define how it's displayed.
    • And as part of saveFilters, generate the filter definition that you need from the fields.

    2. Implement the query generation part for your filter in modules/Reports/Report.php - look out for register_field_for_query or filtersIterate functions.

Children
No Data