reports filter querystring

Our client has a "summary" report which lists revevant records.

They want us to add a link to each row to a "detail" report for that record: we would need to link to the REPORT URL and pass querystring values to pre-populate the filters.

Is this possible?

I have found the reports filter panel widget where the filter values are set.

I have found that the Reports record view is interpreting the query string as the LAYOUT parameter and so results in a BLANK page as there is no such layout, it should be using the same 'record' layout as per default.

I guess I need to add a custom route somewhere.

https://stackoverflow.com/questions/11671400/navigate-route-with-querystring

this talks about adding a route with "?" but Sugar seems to have a wrapper around the functionality used, so we would need to do something else.

  • https://support.sugarcrm.com/documentation/sugar_developer/sugar_developer_guide_13.0/user_interface/routes/

    looking in include/javascript/sugar7.js

    I see the route for 'record'

    I have an existing custom/include/javascript/customRoutes.js that I can add to:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    {
    name: 'recordQS',
    route: ':module/:id(/:action)?*querystring',
    //callback: 'record'
    callback: function(module, id, action, querystring) { /* like include/javascript/sugar7.js */
    // FIXME: We shouldn't be calling private methods like this.
    // Will be addressed in SC-2761.
    if (!app.router._moduleExists(module)) {
    return;
    }
    app.router.record(module, id, action);
    }
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Then REBUILD and the link to the REPORT with the query string shows the REPORT as hoped.

    e.g.

    /#Reports/9a282978-985e-b953-1250-4f33a53e5aca?auction_link_c=8b9e071d-721e-1432-8c44-62bafc6b3395&auction_link_c1=2023%2F11&display_lot_number_c=1

  • Now I would like to create a custom version of 

    BaseReportsReportRuntimeFilterWidgetView
    If I add a file custom/modules/Reports/clients/base/views/report-runtime-filter-widget/report-runtime-filter-widget.js
    and try
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    ({
    /*
    * run `SUGAR.App.view.views` in console to get list of available views
    * this is BaseReportsCustomReportRuntimeFilterWidgetView
    * when this runs, BaseReportsReportRuntimeFilterWidgetView has not been defined!
    */
    /*extendsFrom: 'BaseReportsReportRuntimeFilterWidgetView',*/
    initialize: function(options) {
    this._super('initialize', [options]);
    console.log("custom ReportsReportRuntimeFilterWidget initialize");
    },
    })
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    then the CONSOLE tells me 'BaseReportsReportRuntimeFilterWidgetView' is not defined to extend from!
    It seems that BaseReportsReportRuntimeFilterWidgetView is defined AFTER the CUSTOM files run!
    Is there a way to customise this?