Restrict Operation Start by User Group

Hi everyone,
In preparation for going paperless I have been asked if we can stop people who are not in the quality group from clocking into operations with quality listed as the resource. I looked at labor.startactivity to do a BPM but I don’t see the fields I need and do not know where to start or if this can be done. Any ideas or thoughts appreciated.
Thanks
Melissa

On startactivity I don’t think you will have all of the needed info yet. I do this on labor.update.

It can be done with conditions if all of your data is in LaborDtl with an action of raise exception.

If you have to get more tables involved then use abl.

Our quality group is in one department and all of their operations are in one resource group, so I could do something like below.

Greg


/* stop quality op if not quality employee */

define variable ResourceJC as character init ''.
define variable EmployeeJC as character init ''.
define variable Msg as character init ''.



For each ttLaborDtl where ttLaborDtl.Company = cur-comp and (ttLaborDtl.Rowmod = 'A' or ttLaborDtl.rowmod = 'U') and ttLaborDtl.ActiveTrans = true no-lock.


                If ttlaborDtl.LaborType = "P" Then Do:

                /*first, we need to see If the departments are not the  same*/


                                  Find first ResourceGroup where ResourceGroup.Company = cur-comp and ResourceGroup.ResourceGrpID = ttLabordtl.ResourceGrpID no-lock no-error.


         Find first EmpBasic where EmpBasic.Company = cur-comp and EmpBasic.EmpID  = ttlabordtl.EmployeeNum no-lock no-error.

          If avail EmpBasic then
                                assign EmployeeJC = EmpBasic.JCDept.

          If avail ResourceGroup then
                                                assign ResourceJC = ResourceGroup.JCDept.


                                                                                If             EmployeeJC <> "Quality" and ResourceJC = "Quality" Then do:

                                                                                                                                                                Msg = "You are not allowed on this operation".

                                                                                                                                                                {lib/PublishEx.i &ExMsg = Msg &ExType = {&MESSAGE_ERR}}.

                                                                End.

                End.

End.
1 Like

Thank you so much. I will give this a try :slightly_smiling_face:
Melissa