Change Resource Group ID for Open Jobs

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?

1 Like

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:


And the action details:

The code I placed in the custom code widget ‘Set TotalRows’:

var row = (from ttResults_row in ttResults where ttResults_row.Calculated_Processed == false select ttResults_row);
TotalRows = row.Count();

The code I placed in the custom code widget ‘Set MyJob’:

var row = (from ttResults_row in ttResults where ttResults_row.Calculated_Processed == false select ttResults_row).FirstOrDefault();
{
    myCount = myCount + 1;
    MyJob = row.JobHead_JobNum;
    MyAsm = row.JobAsmbl_AssemblySeq;
    MyOp = row.JobOper_OprSeq;
    row.Calculated_Processed = true;
}

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? :slight_smile:

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.

Here is the updated code for the ‘Set myJob’ widget:

var row = (from ttResults_row in ttResults where ttResults_row.Calculated_Processed == false select ttResults_row).FirstOrDefault();
{
    myCount = myCount + 1;
    MyJob = row.JobHead_JobNum;
    MyAsm = row.JobAsmbl_AssemblySeq;
    MyOp = row.JobOper_OprSeq; 
    myComp = row.JobHead_Company;
    myReqDueDate = row.JobHead_ReqDueDate;
    myProdQty = row.JobHead_ProdQty;
    myDueDate = row.JobHead_DueDate;
    myStartDate = row.JobHead_StartDate;
    isEngin = row.JobHead_JobEngineered;
    isRel = row.JobHead_JobReleased;
    if (row.JobHead_JobEngineered && row.JobHead_JobReleased)
    {
      isSched = true;
    }
    row.Calculated_Processed = true;
}

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.

I know everyone wants me to move to the DMT. While they consider getting the tool, I am still stuck trying to get this to work.

Stepping back I see that Brandon has a point. GetByID gets my job, and Update updates the whole job.

The basic process I am trying to use to update the job is:

  • Invoke Erp.JobEntry.GetByID (myJob, myDS)
  • Set myDS.JobHead.JobEngineered = false (for the changed row)
  • Also tried: Set ttResults.JobHead_JobEngineered = false (for the changed row)
  • Invoke Erp.JobEntry.ChangeJobHeadJobEngineered (myDS)

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.


(My God! Look at this thing! Someone stop me!)

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:

<ProdLabRate>
<SetupLabRate>
<EstLaborCost>
<LaborEntryMethodDesc>
<PrimaryProdOpDtlDesc>
<PrimaryResourceGrpDesc>
<PrimaryResourceGrpID>
<PrimarySetupOpDtlDesc>
<ShowStatusIcon>
<StdBasisDescription>
<StdFormatDescription>
<ResourceGrpIDDescription>

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?

Thanks a bunch!
Nate

You have to change the rowmod of the dataset to U.

I would do this in small steps, makes debugging easier.

Do I have to do this through custom code? I don’t see RowMod in the setfield widget.

You need to use the update table by query widget.

Might cut down on the number of widgets as well. One stop shop.

This look promising! I get my BPM to run now, and the results in the BAQ screen are updated, but when I Get List from the Analyze tab, I can see the records are not being updated.

For the source query I used the entire ttResults, and for the update query I also used the entire ttResults, with only a few fields modified:
img16

Am I on the right track? Thanks a bunch!

you want to update the object that you just got by using the getbyid. thought is was the joboper or joboperdtl not the ttResults….

So the process I am using is basically:
GetByID (JobNum, myDS)
Update myDS.JobOper Table By Query
Update myDS.JobOpDtl Table By Query
Update (myDS)

For the two update by queries I included only the fields I want to update (ResGrpID, Descriptions, and RowMods). I set the table criteria for JobNum, AsmSeq, and OpSeq using the values pulled from the current row of ttResults. I set the queries to update only changed rows in the table. Is that right?

The action completes without error but the underlying records are not updated. Thanks for working through this with me!

Can you make a video of what you are doing? (screentogif or something)

the ttResults is what is coming from the dashboard. Updating that object is not what you are trying to do.

GetByID (JobNum, myDS)

The myDS is the object you want to update.

Lets see if this works! Thanks for introducing me to screentogif!
Had to upload to drive…

I might need some fine tuning with that program. Things fly by pretty fast after I removed the duplicate frames! Let me know if this is unusable, and I can try again.

You should be able to paste it right into the forum. (edit: I see it’s too big)

But what I actually wanted to see was your results. How is your BAQ working.

My steps:

  1. Get List
  2. Enter criteria. In this case, find all open jobs with resourcegroupid = ‘4AAA’
  3. Run custom action to update required fields.
  4. Observe resulting message box indicating successful execution.
  5. Get List again using same criteria to see if the record was updated (it wasn’t).

Try double clicking on a row, that should change it to yellow, (if it doesn’t you might have to add a check box or something to give you something to change) then run your custom actions, then click update.

edit: I don’t think that will work either. Like @knash said, you are setting your TT fields, but trying to update the DS that you got, so they aren’t the same.

Here is my BPM. I think it is setup correctly based on what I have read, and what you all have said.
It runs ok, but doesn’t update the record. I am going to have to sleep on this for another day.