Mass Job Delete

Hi everyone,
We regularly have large quantities of jobs that require deleting, mainly due to cancellations. At present we are deleting each job individually but this is very laborious and time-consuming. I was wondering if anyone had a method for doing this on mass. We have DMT but I am not sure how many templates I would need to use and if it would end up being quicker. If anyone has done this before we would really appreciate some guidance.
Thanks
Adrian

Hi @Adrian_Mepham
is it a one-off task, or you want to do it on regular bases ? because if it is a regular task you need to do then i suggest to use the Service Connect to do it, to overcome the error record issues, if it is one-off then it is very straight forward, Get your list based on whatever criteria you decide, then DMT the JobHead to allow changes first i.e. UnEngineer/UnRelease if applicable (depends on your environment settings) then run the delete script, bear in mind that any Job record with material transactions, PO linked, Labor transactions, or part transaction can not be deleted and will error out in your log file, the other option is to create a BPM with Custom code to loop through JobHead Database based on your criterias and invoke the delete method, catering for the error messages in case if it happened not to stop the loop, then you may need to attache it to the scheduling agent to run on regular time and emailing someone or throw the results in any UD filed.

Edit:
run quick test, Engineered/Released flags won’t stop Delete method,

1 Like

Hi @A.Baeisa
I think it happens fairly regularly. I am pretty sure we do not have Service Connect, we looked at it a while back but I think the price scared the money people. The DMT looks the easiest option, for now, however, your suggestion of a BPM, scheduled to run at regular intervals is something I might attempt to create. It sounds like a perfect solution.

no problem pal,
at the end of this thread you will find the best solution -so far- to trigger BPM from scheduling task, in case if you need it.

1 Like

That is pretty cool @dkavvouras
Do you have any idea how to remove the demand link without having to manually delete it one at a time @A.Baeisa? That is the error I am getting now in DMT. It says it cannot delete the job because it is referenced by at least one demand link .

my best guess is that you Making to Order or Making to Job, thereby try to delete these JobProd linked records first, try it manually first to verify the concept, if this is what stopping you then you may need to DMT to delete these records first. then DMT to delete the JobHead records.

Thanks @A.Baeisa, we do make everything to order. I am able to delete the demand link manually but when I try to use the DMT I get the message Job Prod not found for all the jobs. I looked in job entry and the links are there

SQL your data for one example ONLY, also try and change MakeToType to [MakeToOrder], add OrderRelNum as well

Edit:
also Run the trace log, and see what parameters are used when delete the demand manually, and make sure that they all exist in your DMT template

1 Like

Hi @A.Baeisa, using ‘MAKETOORDER’ solved the problem. I have just deleted over a thousand jobs from thirteen different sales orders in about thirty minutes! I would still like to go down the BPM route eventually or customisation may be to make the process even slicker. This really got me out of a hole for now though so thank you very much for all the help.
Best regards
Adrian.

1 Like

good morning pal,
glad to hear that i was about to prepare some relevant data to test the DMT process, thanks for let us know, and with regard to the BPM idea, it is obvious to say that you need to cater for this Demand linkes and invoke the delete method as well as JobHead, i.e. same logic applied.

Hello! This topic became relevant to me. I managed to get all unlinked and should delete the jobs now, but DMT with “Job Header” template gives an error of “Object reference not set to an instance of an object.”

Job header template I use:

Company Plant JobNum PartNum JobEngineered JobReleased

PS: I understand that Engineered/Released should not be relevant when using delete in DMT.

To unlink “MakeToStock” these columns are necessary to fill:
Company Plant JobNum PartNum MakeToType MakeToStockQty WarehouseCode

How to delete a job with DMT template? I tried using Job Header, but this error pops up.

DMT is following the same Epicor frontend logic, and up to my knowledge, to be able to delete a job, this job must be UnReleased and UnEngineered, plus other things, so try to do this first and see

I did all that and the same error. It is maybe some refresh thing, but I cannot see anything that could impact it. Maybe some other transaction is for job deletion but not Job Header.

open the error file, and take one of the jobs that DMT error out, and try to delete it manually, may be there is an active transaction or/and active NCR within it

Hi Rennat, in my template I had JobClosed, JobComplete, JobEngineered, JobReleased and JobFirm. I used the JobHead table for the deletion.

1 Like

Thank you! Adding JobFirm as False did the trick. For future reference to delete mass jobs with DMT following template with Job Header can be used:

Company Plant JobNum PartNum JobEngineered JobReleased JobFirm

Which means copy + paste job and part number and all values false.

1 Like

are you selecting the unfirmed ones or you Unfirm them first before deleting ? because you can delete firm jobs from frontend with no issue !! except if there are any transactions in labor table

Makes sense to add it here. I did Unfirm/Unrelease/UnEngineer in the same file, but it did not matter once I added just the column for Unfirm and set value to False.

And I had already prefiltered the jobs without any material and/or labor transactions.

1 Like