Customer Portal

Get Involved. Join the Conversation.


    JN Hutchinson
    'pre_report_get' and passing current answerID as a...
    Topic posted November 8, 2011 by JN HutchinsonGold Medal: 3,500+ Points, last edited November 14, 2011 
    575 Views, 2 Comments
    'pre_report_get' and passing current answerID as a filter

    Requirement description:

    I'm using a modified Grid2 widget to put a form on the page that pulls a list of all the answers in the same sibling set as the current answer.  The user clicks on the sibling answer in the drop down form and it immediately jumps to that answer.

    This works great if there was no kw/ parameter (ie, there was no search parameter in the URL), as the report I use filters on answers.a_id.

    However, if a search parameter is in the URL, it gets passed to the report instead of the a_id and the report fails because it is looking for an integer.

    My thoughts so far:

    I'm thinking the 'pre_report_get' hook can be used to populate the filter with the a_id ... but how?

    For one, I'm not sure how to get the custom model to know what the current a_id is.

    I'm thinking the model code would look something like this, but I'm missing some stuff:


    Code Snippet: