• 1 reply
  • Latest Post - ‏2013-02-06T13:43:05Z by StevenShull
5842 Posts

Pinned topic Dynamic Portlet Result Set on Start Center

‏2013-01-29T19:57:33Z |
I'm trying to use a dynamic query in a result set to filter information across multiple trades. Right now I'm using 6 different start centers that display the same type of information, but to a different group a people. An example is below.

(worktype = 'BD' and persongroup = 'MX-MECH' and owner is null and status = 'APPR' and plant = any ('CF')) order by calcpriority desc, reportdate, actstart

In the query above, maintenance personnel are assigned to one of three different persongroups (MX-MECH, MX-ELEC, and FAC-PLUM) and they are also assigned to one of four plants (CF, RF, SS, PP).

When work orders request an individual from a persongroup to come to a plant and do work. To remove the amount of clutter, we have created a different start center for each persongroup and plant combination. The only difference between these start centers is the hard coded persongroup and plant in their result set queries.

My question: Is it possible to alter my result set query to dynamically filter based on the logged on maintenance personnel's persongroup and plant?

Updated on 2013-02-06T13:43:05Z at 2013-02-06T13:43:05Z by StevenShull
  • StevenShull
    501 Posts

    Re: Dynamic Portlet Result Set on Start Center

    Yes queries have the concept of dynamic variables (such as :USER) that can allow you to change based on information linked to that person. A person, however, is not restricted to be in one person group (in your business practice it sounds like that is the case, but business practices sometimes change so it's something to be thinking about if seeing records for more than one persongroup matters).

    To get down to persongroup you have to go through the persongroupteam object for the personid of the current user (SELECT personid FROM maxuser WHERE userid=:USER) but I think you can figure out the rest.