Stop work order deletion, but not operation or parts deletion

Hello everyone,
I am looking to give access to some employees to update work orders by deleting/adding/editing operations and parts, but not be able to delete the work order.
I realize if there is a transaction it will prevent them from deleting the work order, but I am trying to prevent it before there is any transactions recorded.
I tried service security for BO.JobEntry method DeleteByID. This method prevents job deletion, unfortunately it also prevent part and operation deletion as well.

Trace shows method update for JobEntry for both job deletion and operation deletion.
Is there a way to distinguish between job deletion vs operation deletion in pre-process?
or
Is there a method or flag that indicates that job can be edit/updated but not deleted?

It would also be nice to be able to give access based on groups?

thanks,

Amin

In a BPM, there is the ability to have a condition block be based on the user/group that calls the BPM.

1 Like

Hi Calvin,
Good point, but my main problem is what method is for job deletion and what method for operation deletion. They both seem to reference Update for JobEntry.
thanks

When deleting Material, the deleted row tablename is “JobMaterial”

See the forth from the last row below

<tracePacket>
  <businessObject>Erp.Proxy.BO.JobEntryImpl</businessObject>
  <methodName>Update</methodName>
  <appServerUri>net.tcp://usdcaaps00371/UAT_102300/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>2/21/2020 14:50:01:4800291 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="123" roundTrip="98" channel="0" bpm="0" other="25" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.JobEntryDataSet">
      <JobEntryDataSet xmlns="http://www.epicor.com/Ice/300/BO/JobEntry/JobEntry" />
    </parameter>
  </parameters>
  <paramDataSetChanges>
    <paramDataSet name="ds" useDataSetNbr="0">
      <deletedRow tableName="JobMtl" rowState="Deleted" rowNum="1" />
    </paramDataSet>
  </paramDataSetChanges>
</tracePacket>

When deleting the job, you’ll see all the tables.

 <paramDataSetChanges>
    <paramDataSet name="ds" useDataSetNbr="0">
      <deletedRow tableName="JobHead" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobAsmbl" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobMtl" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobOper" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobOpDtl" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobPart" rowState="Deleted" rowNum="0" />
      <deletedRow tableName="JobProd" rowState="Deleted" rowNum="0" />
    </paramDataSet>
  </paramDataSetChanges>

I did some light testing, you will want to fully test this for any loopholes.
Using the BPM below I was able to prevent JobHead deletion but was still allowed to delete Job Assemblies, Operations, Mtls, etc.
You definitely need to have this tied to a user security group since other process (MRP) and users need to delete Jobs.
Method: JobEntry.Update
Pre-Processing Directive
Two Condition:
-There is at least one deleted row in the ttJobHead table
AND The user who called the method belongs to the NoJobDelete group
If true then Raise Exception message that Job Deletion is not allowed

2 Likes

You scooped me!!

edit: (if only I hadn’t wasted the time actually selecting a Sec group in the condition block …)

2 Likes

Working on some thing similar for PO’s. Set this up the same way, but I need be able to delete after the warning. Do I need to set the warning or something else up to allow deletion? For PO’s, the issue is that people are not paying attention to whether they are deleting a line or the entire PO. Same deletion warning out of the box.

Thanks in Advance,
Eric

You want a warning with the option to continue or cancel?

Something like:

You're about to delete this PO.  Do you wish to continue?

[ Yes ]  [ No ]

Correct, with Yes deleting it and No taking you back to the screen.

The following is a crude explanation. Let me know if you need more details.

  1. Create a BPM form. It will have one defaul button.
    image
    Add another (for “No”)
    image

  2. Call the BPM form in the BPM.

  3. After the BPM Form widget, have it flow into a condition and check for CallContext Button equal to one of the values from the BPM Form

image

image

Edit

(some notes for clarification.)

In the screenshot of the JobEntry.Update BPM:

  • Condition 0 checks for to see if it is the whole PO AND the user/group (see prior posts)
  • Condition 2 checks to see which button was pressed.
3 Likes

Doesn’t seem to be working for me. I created a new group and test user. The test user not part of the group can delete operations, parts and work orders.
Am I missing a setup somewhere, like company/site maintenance?
Or is it version based. We are on 10.2.100.6
image

Are you sure you enabled the Directive?

That directive only checks for the JobHead AND if the user is in the group. Effectively preventing users in that group from deleting the JobHead (whole job).

Anyone can still delete Mtls, Ops, etc…

Anyone not in that group can still delete the JobHead (whole job)

(edited for clarity)

1 Like

Yes, it was checked as enabled. I am just testing to see if another BPM I have works as it should.

Calvin,
for now if they can’t delete the job, it works for me. But looks like they can delete everything in this situation.

Based on your screen shot of the BPM …


User is in       Can Delete       Can Delete 
Adv Prod Team    Mtl, Ops, etc    JobHead
==============   =============    ===========
     YES              YES              NO
     NO               YES              YES    
1 Like

Shoot, I forgot to save after I changed the belongs to group to does not belong to the group.
That fixed it.
thanks a lot.

@ckrusen, I may have beat you to post, but apparently @AminV likes your solution better.

1 Like

sorry Rick, I marked both as solutions. I didn’t know only one can marked.

Not complaining, just messing with @ckrusen.

1 Like