Customer Portal

Get Involved. Join the Conversation.

Topic

    Pathaksa Tongpitak
    Access Level Menu Filter in ReportsAnswered
    Topic posted July 27, 2012 by Pathaksa TongpitakSilver Medal: 2,000+ Points, last edited July 27, 2012 
    340 Views, 4 Comments
    Title:
    Access Level Menu Filter in Reports
    Content:

    How do I create an Access Level report filter?

    Whenever I try the filter settings below it treats the fiter like "~any~" instead of just in menu  (access level ID).

     

    ps. can this topic be moved to Customer Portal sectino?

    Code Snippet:

    Best Comment

    Jeremy Watson

    Have you tried to set the data field to either '7,8,9' or '7;8;9'?  It might be expecting a string that looks like a list, rather than an array.

    If that doesn't work, what does $hookData['data']['filters']['access_id'] look like before you start setting the fltr_id, oper_id, etc. values?

    James

    Comment

     

    • Allan Schrum

      I have moved this to Customer Portal as requested.

    • Pathaksa Tongpitak

      Thank you.

      I am now using an hook and want to put access filters with operator type "In menu".

      However the code below treats the filter as equal as last item in array, in this case with equals access ID = 9.

      Am I doing something wrong?

      function PreReportGetHook($hookData)
      {

          if($hookData['data']['reportId'] == '100767')
          {
              $accesslevels = array(7,8,9);
                     
              $hookData['data']['filters']['access_id']->filters->fltr_id = 1;
              $hookData['data']['filters']['access_id']->filters->oper_id = 10;
              $hookData['data']['filters']['access_id']->filters->data = $accesslevels;
              $hookData['data']['filters']['access_id']->filters->rnSearchType = 'custom';     
          }

      }

       

    • Jeremy Watson

      Have you tried to set the data field to either '7,8,9' or '7;8;9'?  It might be expecting a string that looks like a list, rather than an array.

      If that doesn't work, what does $hookData['data']['filters']['access_id'] look like before you start setting the fltr_id, oper_id, etc. values?

      James

    • Pathaksa Tongpitak

      It works indeed when you use a string like "'7,8,9'" instead of an array. Thanks very much!