"Input String was not in a correct format", invoicing drop shipment

I am working on a ticket to help accounting with a problem on adding a Drop Shipment to an invoice group.
There is nothing interesting about this particular drop shipment.

When I select the dropshipment in an invoice group (via “Get Shipments”), I select the shipment

Select it, and click ok


A modal dialog asks “Are You Sure” and I click OK.
Then an exception is thrown:

In the app server logs, the error is as follows:

Ice.Common.EpicorServerException: Input string was not in a correct format. ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at Compatibility.Convert.ToInt32(String value) in C:\_Releases\ICE\RL10.2.600.0FW\Source\Server\Internal\Compatibility\Convert.cs:line 334
   at Erp.Internal.AR.GenInvFromDropShipment.CopyShipHedOTS() in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\GenInvFromDropShipment\GenInvFromDropShipment.cs:line 1091
   at Erp.Internal.AR.GenInvFromDropShipment.CreateDetail(ARSyst ARSyst) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\GenInvFromDropShipment\GenInvFromDropShipment.cs:line 1401
   at Erp.Internal.AR.GenInvFromDropShipment.RunGenInvFromDropShipment(String CurGroup, Boolean BillToFlag, ARSelectedDropShipTable ttARSelectedDropShip, Boolean consolidatePS, ARSyst ARSyst, InvcGrp InvcGrp, String& cInvoiceNum, String& cErrors, String& opErrorMessage, Boolean& opCommFailure, Int32& numInvs) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\GenInvFromDropShipment\GenInvFromDropShipment.cs:line 742
   at Erp.Internal.AR.GenInvFromDropShipment.RunGenInvFromDropShipment(String CurGroup, Boolean BillToFlag, ARSelectedDropShipTable ttARSelectedDropShip, Boolean consolidatePS, ARSyst ARSyst, InvcGrp InvcGrp, String& cInvoiceNum, String& cErrors, String& opErrorMessage, Boolean& opCommFailure, Int32& numInvs, String& PSConsMessage) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\GenInvFromDropShipment\GenInvFromDropShipment.cs:line 551
   at Erp.Services.BO.ARInvoiceSvc.GetDropShipments(ARInvGetDropShipTableset& ds, String GroupID, String CustList, String Plant, Boolean BillToFlag, Boolean consolidatePS, String& Invoices, String& Errors, String& msgNumInvoices, Decimal& grpTotalInvAmt) in C:\_Releases\ERP\UD10.2.600.10\Source\Server\Services\BO\ARInvoice\ARInvoice.cs:line 9639
   at Erp.Services.BO.ARInvoiceSvcFacade.GetDropShipments(ARInvGetDropShipTableset& ds, String GroupID, String CustList, String Plant, Boolean BillToFlag, Boolean consolidatePS, String& Invoices, String& Errors, String& msgNumInvoices, Decimal& grpTotalInvAmt) in C:\_Releases\ERP\UD10.2.600.10\Source\Server\Services\BO\ARInvoice\ARInvoiceSvcFacade.cs:line 1451
   at SyncInvokeGetDropShipments(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28
   --- End of inner exception stack trace ---

Insofar as I can tell, there is nothing interesting or unique about this particular drop shipment. I have even tried re-creating the entire drop shipment from scratch and the issue persists, even with an entirely new pack slip.

Any help or workarounds are appreciated

Are you passing the VendID when it wants the VendNum? The ‘StringToNumber’ is where I’d start looking. What do the ds look like in a trace log?

And was that drop ship using a One Time ShipTo?

1 Like

I know you can get that with a blank string as well. Double check the OTS info.

EDIT:
Looking at the DLL, it looks like there are two items being converted ToInt32.

The DropShipHead.ShipToNum that uses OTS usually has a format like OTS00000/00000. I would bet the OTSELM pictured above has a similar ShipToNum beginning? Maybe it starts with OTS but doesn’t follow this format?

The CopyShipHedOTS() first looks for the ShipToNum starting with “OTS”. It pulls the first number from ShipToNum.SubString(3,5) which is the POLine, then ShipToNum.SubString(9,5) is the PORelNum.

If your ShipToNum starts with OTS then it thinks it is an OTS shipment and you’re receiving the error.

1 Like

Hey Calvin, I am not sure what would change. Any other drop shipment works just like this, but on this particular record it’s failing. This is just base functionality, nothing custom. I think the stringtonumber is a deep down in the bowels of Epicor function that is inside on of the many dlls used. I remember Johnathan mentioning this before Customer Statements will not print-Issue with 1 old invoice - ERP 10 - Epicor User Help Forum (epiusers.help) and there might be something goofy with their trash-tier implementation of it.
In this case, I don’t have any idea which string it doesn’t like as I’m simply selecting a row in a dataset which is un-editable to then create an invoice from.
Other shipments using the same process are creating invoices without issue.
re: One Time Ship to, we do not use that functionality and the order is not marked as such, but I am wondering if perhaps there is a hidden character in there somewhere? Both you and Dough mentioned it and I’m curious what leads you both to believe it. It’s a lead worth pursing…

Ohhh you know what the ship to ID does start with OTS(ELM) and I bet that’s exactly what this is. What the hell Epicor lol!! Perhaps they should use something a little more indicative of a one time shipment rather than reading a magic string, and of course there is no indication that we should not have prefaced an account with OTS anywhere, wow.

That’s so garbage I can’t even think of what to say, and it doesn’t appear that I can change a ship to num in the system once it’s in there.

1 Like

I would look at all your ship to numbers and see if maybe some kind of data fix is available for this? If not you may be stuck.

The DLL should verify the full format since they don’t keep you from using OTS* in the ShipTo records. The order has a check box for the UseOTS, that’s what they should be using to verify instead of looking at the first 3 characters in a string.

1 Like

Absolutely, they probably shouldn’t let the interns push their homework to production, but here we are :wink: Thank you so so much! I owe you a beer. I am going to back the whole damn transaction out and use a new ship to. First time in 9 years of using this I’ve run into this

1 Like

I was reading along this morning and I got to this post, thinking “Oh, he doesn’t see it.”

Then I scrolled down:

I’m laughing, crying, and disgusted with you :rofl: :cry: :face_vomiting: