And, if your login and person id are different, then it will be a little more complicated, but it still works:
(ownergroup in
(select persongroup from persongroup where persongroup in
(select persongroup from persongroupteam where respparty in
(select personid from person where personid =
(select personid from maxuser where userid = :USER )))))
Here is a full where clause against MAXDEMO as an example, which looks for non-task / non-historical work orders where the logged in user is in the assigned person group (work group) or owner group:
((woclass = 'WORKORDER' or woclass = 'ACTIVITY') and historyflag = 0 and istask = 0 and siteid = 'BEDFORD')
and
(ownergroup in (select persongroup from persongroup where persongroup in (select persongroup from persongroupteam where respparty in (select personid from person where personid = (select personid from maxuser where userid = :USER ))))
or
persongroup in (select persongroup from persongroup where persongroup in (select persongroup from persongroupteam where respparty in (select personid from person where personid = (select personid from maxuser where userid = :USER )))))
------------------------------
Christopher Winston
Projetech Inc.
IBM Champion 2024
------------------------------
Original Message:
Sent: 07-04-2024 10:47
From: Nikolaus Despain
Subject: Query work orders by person group
If you want to make the query generic so it can be used by anyone (perhaps on a Start Center) change "Person x" to ":USER" and it will provide the Work Orders for the person who is logged in…
[Slight change if you use "ownergroup"]...
"where ownergroup in (select persongroup from PERSONGROUPTEAM where PERSONGROUPTEAM.RESPPARTYGROUP = :USER)"
------------------------------
Nikolaus Despain CRL
Aquitas Solutions
Original Message:
Sent: 07-03-2024 11:37
From: Craig Kokay
Subject: Query work orders by person group
Hi Genevieve,
Unless I'm mistaken, you've answered your own question.
A work group is a collection of people; therefore, you only need to query the work group.
Maybe you asking "show me all the work orders for person X based on the work groups that they belong to. For example: Person X belongs to person groups A, C, and E. You are looking at
"where persongroup in (select persongroup from PERSONGROUPTEAM where PERSONGROUPTEAM.RESPPARTYGROUP = Person X)"
------------------------------
Craig Kokay
Principal Consultant
COSOL
email: craig.kokay@cosol.global
#IBMChampion
Original Message:
Sent: 07-03-2024 11:17
From: Genevieve Ahern
Subject: Query work orders by person group
I'm trying to create a query to view all open work orders by each individual part of a person group. Is there a way to do so? I basically want to see all work orders that everyone within a specific person group has open. They could be work orders with various work groups. I would then view by WO owner in a portlet on my dashboard.
#WorkManagement
------------------------------
Genevieve Ahern
AbbVie, Inc.
------------------------------