JobProd Table exists in 2 BOs

Hello all,

Run into something I haven’t seen before. While trying to use the JobProd table, it exists in both SalesOrder BO and JobEntry BO, which are both referenced in my function.

“The type JobProdRow exists in both Erp.Contracts.BO.JobEntry and Erp.Contracts.BO.SalesOrder”


I assume that “JobProdRow” needs to become something like “JobEntryTableset_JobProdRow” but any syntax I try does not exist. Must be something simple I’m overlooking.

Thanks in advance

I think it’s giving you a hint as to what prefix to use. Try ‘Erp.Contracts.BO.JobEntry.JobProdRow’.

This tells the compiler that you specifically want the JobProdRow from the JobEntry BO.

After I add JobProd I reference it like jobEntryTS.JobProd[0].

job.GetNewJobProd(ref ds, headerRow.JobNum, headerRow.PartNum, 0, 0, 0, ttr.JobProd_WarehouseCode, string.Empty, 0);
          ds.JobProd[0].MakeToStockQty  = Convert.ToDecimal(ttr.Calculated_MakeToStockQty); 

          job.ChangeJobProdMakeToStockQty(ref ds);
          job.Update(ref ds);

Unfortunately, you can’t do that :sob:
They both map to Erp.Tablesets.JobProdRow

You can try switching to use var, which may work if the types are identical.

Edit: Depending on what you’re doing, you could also use dynamic.

Or you can load the type via reflection.

You can also break it into two functions, however they will have to be in separate libraries :cry:

1 Like

Aw darn, I was hoping I could do JobEntryTableset.JobProdRow & SalesOrderTableset.JobProdRow.

I’ll mess around with var & dynamic and see if I can get it to behave, thanks for the resource thread on that. Ideally, this is all contained within 1 function library, but it’s not the end of the world if not (with proper documentation :grimacing:).

Maybe I am incorrect on this, but I haven’t been able to directly update OrderDtl through the OrderDtlSearch Service. I assume that’s because the Search Tableset doesn’t allow for updates?
I simply need to populate the “OrderDtl.Reference” field. (which is done with a row-update on the App Studio layer right now, but needs to be part of the function).

Just wondering if I’m going about this all wrong.

Sounds pretty simple, I’ll get back with you when I get to work if someone hasn’t popped along and answered that.

using var did allow the JobProd to be used regardless of the parent table.

Now that I could used SalesOrderSvc, I went through it to get all of the OrderDtl tables related to the order, then used select to get the line that I need.

Made the changes that were necessary (thought maybe because DMT required Company, OrderNum, Line, and Part that the code may require it to update properly, that isn’t the case though).

So I guess I am left to conclude that the OrderDtlSearchTableset doesn’t allow for updates.
Thanks for the direction, I’m only a few years into coding & about 1 year into Epicor, so there’s a lot to learn and be confused about! :laughing:

1 Like

So you’re good?

Believe so, requests are going through and the data I expect is showing up.
Thanks a lot!

1 Like