Updateable baq/dashboard on PartWip, trying to change bins

So we’ve had quite a bit of consternation just trying to do a simple move WIP from one bin to a different bin. The Epicor screens are ridiculously complicated and you have to know so much information to make them work, they are basically useless.

All we want to be able to change is the PartWip.BinNum field. We don’t want to move anything from a different operation, or assembly sequence or any of this other garbage that epicor is trying to require.

So I am trying to make a Ubaq to be able to change that field. So add the PartWip table to the BAQ, add some fields, and turn on the updateable check box. The suggested BO’s are PartWipSearch (which can’t change anything right?) and the WorkQueue. Not really what I’m looking for, but we’ll try the WorkQueue. So I see what columns it’s asking for, and its asking for things that aren’t a table (PartWipOp, and WorkQueue) but I can replace those with the corresponding values from the PartWip table that I am using.

So Get everything replaced (because I don’t want to change any of that garbage anyways), and I go to test a row, and when I update, I get this error

Severity: Exception, Table: WorkQueue, Field: , RowID: b4645885-ccfa-42ff-858e-cac8f2085d63, Text: Resource Group not available: Do not call GetRows directly. Use GetOpsInResourceGroup method instead.

Can anyone tell me what that means? And how I can get around it?

Brandon,
Do a trace on the regular Part Wip move screen and see which BO’s they use. I’m pretty sure you don’t need to use the WorkQueue BO for this.

1 Like

So I did the trace. There are a bunch of methods that it calls. I skipped all of the get lists, and validate because those are from typing in fields.

It calls this one twice.
Erp.Proxy.BO.IssueReturnImpl
GetNewJobAsmblMultiple

Then this one twice.
Erp.Proxy.BO.IssueReturnImpl
OnChangingJobSeq

The this one
Erp.Proxy.BO.IssueReturnImpl
OnChangeTranQty

Then Finally this one.
Erp.Proxy.BO.IssueReturnImpl
PrePerformMaterialMovement

Since none of them are update or updateExt, I don’t think I can use them in a Ubaq right, (I guess without using a BPM to call them manually…)

To me it looks like my best bet would be to make all of the calls in C# in a dashboard customization right?

@Banderson you can use a UBAQ. Just click that “Advanced BPM” option instead of the standard BO stuff and you can write the C# (on the BAQ) to do the update.

1 Like

ok, Newb question here. Which method do I put the coding on, and is it pre or post-processing? (or does this end up being one of those scary Base processing ones?!?!?!?)

And, finally, I’m assuming the code in the UBaq or the Customization can accomplish the same thing, is one better than the other for any reason? Ultimately, this will end up in a dashboard with a customization on it because I will need cheat buttons and validation and whatnot. Is it easier to just do all of it in one place? or is it better to do as much as I can in the BAQ and then only what I need in the final customization? Am I starting a religious debate here?

Update. =-> base Processing.

anyone on the second part of the question?

Yes they can both acomplish the same thing, I prefer UBAQs because a) its faster (server side code) and B) you don’t have to deploy menus etc… twhen you make changes. NO cache issues etc.

1 Like

Any idea why it would call the same method twice in a row? With the same parameters?

  <businessObject>Erp.Proxy.BO.IssueReturnImpl</businessObject>
  <methodName>GetNewJobAsmblMultiple</methodName>

    <parameter name="pcTranType" type="System.String"><![CDATA[WIP-WIP]]></parameter>
    <parameter name="pcMtlQueueRowID" type="System.Guid"><![CDATA[00000000-0000-0000-0000-000000000000]]></parameter>
    <parameter name="pCallProcess" type="System.String"><![CDATA[MoveWip]]></parameter>
    <parameter name="ds" type="Erp.BO.SelectedJobAsmblDataSet">
      <SelectedJobAsmblDataSet xmlns="http://www.epicor.com/Ice/300/BO/IssueReturn/SelectedJobAsmbl" />
    </parameter>
    <parameter name="pcMessage" type="System.String"><![CDATA[]]></parameter>
    <parameter name="CallContext" type="Ice.Bpm.Context.ContextDataSet">

@josecgomez You wouldn’t happen to have an example of a UBAQ that has some code in it that I can look at to see what I need to do in the BAQ would you? The screens and the context are a little different from the BPM run custom code compared to the Customization screens, so I’m not exactly sure where I am supposed to put what.

Sure here you go

foreach(var r in ttResults.Where(r => r.Updated()))
{
      using(var laborBO = Ice.Assemblies.ServiceRenderer.GetService<LaborSvcContract>(Db))
      {
              LaborTableset lds = new LaborTableset();
              laborBO.GetNewLaborDtlWithHdr(ref lds,r.EmpBasic_EmpID, false, date, 0, date, hours);
                lds.LaborDtl[0].LaborType = "P";
                lds.LaborDtl[0].LaborTypePseudo = "P";
                lds.LaborDtl[0].JobNum = r.JobHead_JobNum;
                lds.LaborDtl[0].ExpenseCode =r.Calculated_ExpCode;
                lds.LaborDtl[0].LaborEntryMethod = "T";
                laborBO.LaborRateCalc( ref lds);
                laborBO.DefaultOprSeq(ref lds,opSeq, out msg);
                laborBO.LaborRateCalc(ref lds);
                laborBO.CheckWarnings(ref lds,out msg);
               laborBO.Update(ref lds);
      }
}

I think I might be over my head on this one.

I’m assuming that this replacing the using statement at the top of the code in a customization right? How to I translate the trace to figure out this version of the using statement?

using(var laborBO = Ice.Assemblies.ServiceRenderer.GetService(Db))

I’m starting with the GetByID on the JobEntry BO.

in the customization I would use these in the using statements.

using Erp.BO;
using Erp.Adapters;

Then something like this in the loop to create the data set.

var JA = new JobEntryAdapter(oTrans);
JA.BOConnect();
JA.GetByID(JobNumberHere);

So if try to put that in the context for a Ubaq

foreach(var r in ttResults.Where(r => r.Updated()))
{
     using(var JA = ???? That's where I get stuck, haha.

Should I just do it in the customization since I at least have some vague idea what I’m doing there?

haha no! using is not just for using statements. Using is just syntax that ensures that an object is disposed at the end of its “use”

You can go the customization route, or you can try to persevere here and learn something new.
The code I provided you can paste vervatim in your UBAQ. Though it is related to Labor and not Job. Then you would change the LaborSvcContract for the JobEntrySvcContract and everything else should work.

You then use the laborBO (object) being instantiated in the using to make the same calls you would on the Adapter.
I’ll write you a quick example you can download.

1 Like

can I just invoke the methods and add the parameters? (and it’s always a balance of me learning new stuff, and you getting annoyed at teaching a newb how to do something that he should learn in a CS class haha)

Absolutely! you can use the drag and drop stuff shudder If you go that route you are on your my friend. I’m almost certain that is more dificult haha but I only say that form this side. I’ll give you the example anyways.

I’m always happy to have both. I would imagine that I would have to have some C# in there to make this work. but we’ll see. Thanks a bunch for your help.

I’m signed up for the intro to C# and the using visual studio with epicor classes at insights, I really think (hope) that those two things will really help me learn more coding.

1 Like

Here is an example. Simple BAQ Updates the PartDescription field on JobHead using the BO

image

UpdatableBPMCustomCode.baq (27.3 KB)