Well, the BO doesn’t work the way we want it to. There’s probably a good reason why the Epicor BO is not allowing a direct update of the Resource. Epicor may be making changes in other places of the database that you are not aware of. Maybe Capacity Planning? Costing? Capability Planning? We just don’t know. That’s why it’s best to work through the BOs the way the Client would and then automate from there instead of trying to get around it.
Have you run a trace of how to change a Resource Group on an Operation from the client?
I was afraid of that. That is a good reason.
I guess I just have to wait until they fix the BO?
I ran my trace on the JobEntry form. I manually found a job with ‘12VA’ an then started the trace, updated the code to ‘4A’, and then read the trace.
I assume you don’t want 15,000 lines of trace data. So the potentially relevant methods from my trace are:
Update
ChangeJobOpDtlResourceGrpID
CheckInactiveSchedRequirement
GetDatasetForTree (this probably isn’t relevant)
These types of methods are usually checks between lookup and the update. Sometimes they just check for errors, sometimes they do the change in your dataset (so you don’t have to in code).
I would rerun that trace, but start with a blank screen. Have all of your lookup values handy so you can typed them in instead of searching for them (because you won’t need the search stuff) But you will need a dataset populated, and your list methods doesn’t have anything that does that. So that dataset was populated before you started the trace.
Yes! I got that utility this morning and I already love it! That is actually how I am getting the list of methods to use. I will try to use all BO widgets instead of doing it all in code.
I did modify the code to try to use just the methods:
There has to be something missing in that process. The GetByID returns everything on the job. Then the update is only the job data set and the whole job. Something has to be set somewhere so that the method knows which resource ID (AsmSeq, and OpSeq) to change.
Just putting my two cents in, but I know when we manually change a resource on a scheduled job, it causes various things to happen IF that job is not removed from the schedule and then re-scheduled. Make sure you can do this or you will run into this.
Global scheduling may handle it but how often do you want to run it?
I get this error for every row I tried to process. In my case 123 operations returned in the query. Thankfully epicor put them all into one error window so I didn’t have to click ok 123 times!
Operation Detail is not available.
Message No.: 1
Description: Operation Detail is not available.
Program: Erp.Services.BO.JobEntry.dll
Method: ChangeJobOpDtlResourceGrpID
Line Number: 11770
Column Number: 17
Table: JobOpDtl
My BPM may look a bit convoluted. I have to loop through each of the rows in my results query. Here is my BPM outline and variables:
I think this will be a regular task for a while as we update our internal systems to match the shop floor. However, I expect once the update is done we won’t be changing this kind of thing regularly. Maybe i’m making a mountain from a molehill, but its the journey not the destination. Right?
In an effort to implement this criteria, I have updated my BPM to check for engineered and released statuses. The BPM stores these values internally for each row of the query. Then at the end resets the original status based on that variable. Perhaps it is just my ignorance, but I couldn’t find a flag in the JobHead table for ‘isScheduled’. To determine if the job is scheduled, I just checked to see if both engineered and released are checked. If they are, then I assume it has been scheduled. (This is a big assumption on my part! Is there a better flag to check if a job is scheduled?)
Below I have included my updated BPM with all the criteria and BO methods in place. I also included a small portion of the resulting errors.
Partial list of Errors:
JobHead has not changed.
JobHead has not changed.
Can not remove from schedule, Job is still engineered.
Operation Detail is not available.
JobHead has not changed.
When I try to run this action I get the “Job has not changed.” error occurring on the method line. Of course this is a vastly simplified version, but I want to make sure I am taking the right approach.
The BPM is huge and ugly now that I included all the extra criteria to check and reset Engineered, Released, and Scheduled.
Did you use the trace utility to see what changed from the original data set to the final one? The BO’s change some stuff, but other stuff is changed by the UI and doesn’t show up in the trace. Those differences are what you would need to set using a set field widget.
Yes, I did run the trace while updating a job using the JobEntry form.
I opened the form, then started the trace.
Typed in my job number.
Clicked Op 40 in the tree view.
Clicked the Resource in the tree view.
Selected a new Resource Group from the list.
Copied the value from the Resource Group box.
Clicked on Op 40 in the tree view.
Pasted that value back into the operation Description field.
Saved the job.
Ended the trace.
I am using the trace parser.
When I compared the Update methods, I noticed a lot of fields marked as changed contain a decimal “0.000” and the return show integer “0”. I don’t need to worry about these right?
Otherwise I see a few other fields changed that I am not accounting for, including:
If I am understanding correctly, I need to set the values for these fields using a process similar to what I outlined above. Right? When I use the setfield widget do I set the ttResults field or the tableset field?