WCF to Set Order Shipment as Ready to Invoice

(Doreen Corriera) #1

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.

(Jeremy Chance) #2

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)”.

(Chris Conn) #3

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

(Jeremy Chance) #4

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);

(Chris Conn) #5

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.

(Doreen Corriera) #6

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.

(Jeremy Chance) #7

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

(Jeremy Chance) #8

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?

(Doreen Corriera) #9

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

(Jeremy Chance) #10

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


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

(Doreen Corriera) #12

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);

(Chris Conn) #13

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

(Doreen Corriera) #14

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

(Doreen Corriera) #15

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


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

(Chris Conn) #16

You can try:

(Doreen Corriera) #17

Hmmm - do I need a Service or Assembly Reference?


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