Change Resource Group ID for Open Jobs

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.

Lets start simple by making only two calls in TEST.

One BO to get the Job Erp.JobEntryGetByID. For now since this is a test hardcode a jobnum.

Then you have your return job object called tsJobs.

Next call the BO Erp.JobEntry.ChangeJobOpDtlResourceGrpID. Note that you can pass the callContextBPMData.ShortChar01.

Does that work? Sometimes, the BO that does the change updates the database. You will need to test that out.

If the database table isn’t updated thenAdd two more widgets to update the tsJobs.RowMod = “U” and then one to run the BO Erp.JobEntry.Update

If you are good to go then do that again with the JobOper. By doing this in steps you will learn how the BO work and what is all going on when you make the calls.

Knowing the trace and then creating the BPM to mimic the trace is an acquired skill, you might drive yourself mad, but you will get there. :slight_smile:

1 Like

Good morning,
Thank you for taking time to work this out with me. I replicated the TEST method you showed. I keep coming up to the same error when running the ChangeJobOpDtlResourceGrpID method.

Operation Detail is not available.

Could there be something locking up my op detail? Based on Ruth’s input earlier, I also tried to add a method to Change Job Engineering and Released, but these also fail with an error.

Job has not changed.

For clarity, I am not using the callcontextBPM yet, just a hard coded value. Eventually when this BPM is run from my customized dashboard, then I will pass in the callcontext fields that are set by the user.

I am not familiar with that error.

are you able to change it in the entry screen with no errors?

are you trying to set it to a valid resource group?

The resource group ID is valid. I can change the value in the JobEntry form. That is how I did the trace. Do you mean in JobEntry, or in the BAQ? I would have to switch from ‘Advanced BPM Update only’ to ‘BPM update’ if I want to test the BAQ that way. I’ll take a look at that approach next, but from memory I believe we did have problems setting the ResGrpID from the UBAQ screen.

I reran a trace again today and found the same list of methods. I also found this helpful list of methods with descriptors and parameters for reference:
https://github.com/virall/EpicorIntegration/blob/master/JobStatusByPlanner/bin/Debug/Epicor.Mfg.BO.JobEntry.xml

I know that my trace didn’t show it, but should I be implementing GetDetails, or some other method?

When you ran the trace. What were all the methods called during your test run?

Is that posted? I maybe missed it

img17 img18

Are you using GetDataSetForTree()? that’s the one that is going to get the data set that you need.

That method will let you populate the JobEntryDataSet with just the asm seq you want. Which makes more sense when the changes only take the change, and not which one needs to be changed.

In the trace utility, compare that method to itself, you should be able to see what was added.

What @Banderson said. The GetID is not the correct BO to use. follow the trace. lol

When I compare the first GetDatasetForTree method to itself I found a few values changed. I assume some method calculates the values for these. I am not sure how I would figure them if I had to update these values myself. Do I need to run UpdateTableByQuery for all these tables/values?

  <JobAsmbl>
	  <TLELaborCost>
	  <TLEBurdenCost>
	  <SysRevID>
  <JobOper>
	  <ProdLabRate>
	  <SetupLabRate>
      <ProdBurRate>
	  <SetupBurRate>
	  <OpDesc>
      <SysRevID>
      <EstBurdenCost>
      <EstLaborCost>
      <PrimaryProdOpDtlDesc>
      <PrimaryResourceGrpDesc>
      <PrimaryResourceGrpID>
      <PrimarySetupOpDtlDesc>
  <JobOpDtl>
	  <ProdCrewSize>
	  <SetUpCrewSize>
	  <SysRevID>
	  <ResourceGrpIDDescription>
	  <RowMod>

In the trace you should see something like this. This the BO we want to call with the parameters.

<tracePacket>
  <businessObject>Erp.Proxy.BO.JobEntryImpl</businessObject>
  <methodName>GetDatasetForTree</methodName>
  <appServerUri>net.tcp://e102-test/ERP102200/</appServerUri>
  <returnType>Erp.Tablesets.JobEntryTableset</returnType>
  <localTime>7/26/2019 09:17:39:3779206 AM</localTime>
  <threadID>1</threadID>
  <executionTime total="213" roundTrip="168" channel="0" bpm="29" other="16" />
  <retries>0</retries>
  <parameters>
    <parameter name="ipJobNum" type="System.String"><![CDATA[021105-10-1]]></parameter>
    <parameter name="ipStartAssemblySeq" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="ipCurrentAssemblySeq" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="ipCompleteTree" type="System.Boolean"><![CDATA[False]]></parameter>
    <parameter name="ipJobTypeMode" type="System.String"><![CDATA[MFG,PRJ,SRV]]></parameter>
    <parameter name="CallContext" type="Ice.Bpm.Context.ContextDataSet">
      <ContextDataSet xmlns="http://www.epicor.com/Ice/300/Bpm/Context">
        <BpmData>
          <SysRowID>00000000-0000-0000-0000-000000000000</SysRowID>
        </BpmData>
      </ContextDataSet>
    </parameter>
  </parameters>

1 Like

When you compare it to itself, you are seeing that the method did. It’s showing the input table compared to the output table.

Here is a trace that I did quickly. You should see something similar on your end. Use those two BO calls, see what that gets you.

Yes, my trace looks very similar. I ran the TEST directive with just those two widgets and the same configuration as returned by my trace.
img19 img20 img21

Error Detail

Description: Operation Detail is not available.
Program: Erp.Services.BO.JobEntry.dll
Method: ChangeJobOpDtlResourceGrpID
Line Number: 11770
Column Number: 17
Table: JobOpDtl

This is the same job you ran through on the Job Entry Screen?

Yes. First, I set op40 resourcegrpid to “4AAA”. This is the only job/op with this resourcegrpid. For the trace I changed it from “4AAA” back to “12VA”, an existing resourcegrpid that is used for many jobs/ops.

I keep thinking that something is preventing me from getting at the job operation details to update that field. When I run the UBAQ without advanced directives, and just update it through the BAQ form, I get:

Severity: Exception, Table: JobOpDtl, Field: , RowID: 916f4ab9-fe90-48d3-adba-500bc02ca607, Text: Object reference not set to an instance of an object.

We are close.

ok based on the trace we need to update the tsJobs object.

Note that we are changing to Depot on JobOpDtl OprSeq 10, see the RowMod. We need to set that to U. Using the same process we were trying to do before.