WCF to Set Order Shipment as Ready to Invoice

I am trying to mark a shipping header record as ready to invoice using Epicor’s service calls. I traced the service calls while processing a shipping pack slip as shipped and duplicated the calls. When I try to call UpdateMaster on the shipping record with ReadyToInvoice set to true, it returns a message ‘Value cannot be null. Parameter name: fromItem’. How can I tell what field needs to be set for fromItem not to be null. I do not see a parameter to UpdateMaster or a field in the erp.ShipHead table called fromItem.

In the same boat as you. I’m building a BPM that Un-Ships a PackID. When I call UpdateMaster, I get the same error. If I figure out a solution I’ll post it here for you.

The error says the fromItem is indeed a paramter used in a copy method:
“Server Trace Stack: at Epicor.Data.BufferCopy.Copy(Object fromItem, Object toItem, Boolean includeSysRowID)”.

Can you not just use Update so all of the extra tables arent needed?

The BPM I’m building goes off of an event in a UDTable. So from that BO, I have to bring in the CustShipsvc to make changes to ShipHead. If I set the BPM to simply update ShipHead.ReadyToInvoice = false, the record is deleted for some reason (code below) :thinking:. So rather than doing this, I figured I needed to use UpdateMaster.

CustShipDS = CustShipsvc.GetByID(vPackNum);
var ShipHeadRow = CustShipDS.ShipHead.FirstOrDefault();
ShipHeadRow.ReadyToInvoice = false;
ShipHeadRow.RowMod = “U”;
CustShipsvc.Update(ref CustShipDS);

That is scary that the record is deleted!

Double check a trace when changing the ReadyToInvoice from the UI to make sure it isnt expecting some other call.

I also tried to use Update rather than UpdateMaster. I don’t think the ShipHead record is actually deleted because I can still see it in the database, but it does look like it gets corrupted since you can no longer retrieve it from the order tracker.

I’ve had a case open with Epicor for quite some time concerning this but have yet to receive any feedback.

1 Like

Ya, long story short, it’s looking like you have to use UpdateMaster.

Hi Doreen, May I ask which version of Epicor you’re on? I’m on 10.0, so perhaps this is a 10.0 thing?

10.1.600 – upgraded from 9 about a month ago. Did not have an issue in 9

Got it. Looks like the hunt continues. Again, if I find something, I’ll be sure to post it.

Hi there,

that thing really confused me too…I wanted to set the ReadyToInvoice but faced the same issues you mentioned above.

I have found a workaround that helped me to overcome the problem using the UpdateExt method. (@10.2.200)

let’s say that dsShipHead_iterator is the original ShipHed record having set the readyToInvoice = true and rowmod = U

Then…

Erp.Tablesets.UpdExtCustShipTableset dsExt = new Erp.Tablesets.UpdExtCustShipTableset();
Erp.Tablesets.ShipHeadRow bkpShipHeadRow = new Erp.Tablesets.ShipHeadRow();
BufferCopy.Copy(dsShipHead_iterator, ref bkpShipHeadRow);
dsExt.ShipHead.Add(bkpShipHeadRow);
svc.UpdateExt(ref dsExt,true,true,out cError);
.

I need to revisit this and am trying to code this in a script task in SSIS. What does BufferCopy reference?
BufferCopy.Copy(dsShipHead_iterator, ref bkpShipHeadRow);

That is copying a row you are iterating (dsShipHead) into another row container (bkpShipHeadRow)
Then adding the bkpShipHeadRow to the ExtDataset for use with UpdateExt

Is there a system object that I need to include in my script for BufferCopy to be recognized as valid?

Is there a system object that I need to include in my script for BufferCopy to be recognized as valid?

image

This displays an error “The name ‘BufferCopy’ does not exist in the current context”

You can try:
Epicor.Data.BufferCopy

Hmmm - do I need a Service or Assembly Reference?

image

The type or namespace name ‘Data’ does not exist in the namespace (are you missing an assembly reference?)

I’m in the same situation. Same error, same idea of wanting to un-ship. And my shiphead is getting deleted but leaving the shipdtl!

I’m calling in this order:

  1. GetByID
  2. CheckPCBinOutLocation
  3. Setting ready to invoice as false and row mod on shiphead to U
  4. Calling UpdateMaster
    I’m on 10.2.300.15

We were able to get by this by using the following instead of your step 4:

UpdExtCustShipTableset dsExt =
new
UpdExtCustShipTableset();

ShipHeadRow bkpShipHeadRow = custShip.ShipHead[0];

ShipHeadTable st =
new
ShipHeadTable();

st.Add(bkpShipHeadRow);

dsExt.ShipHead = st;

csClient.UpdateExt(ref
dsExt, true,
true,
out cError);

Hope this helps!

2 Likes

Boom! That fixed the issue. Thanks!

Odd how we usually need to follow the trace exactly, but in this scenario it breaks your data when you do.

I just filed a bug report with Epicor as well. No matter what, your records shouldn’t be deleted.