REST - Add Lines with TransferOrderEntrySvc

I’m trying to add a Transfer Order Line using the REST to call Erp.BO.TransferOrderEntrySvc/TFOrdDtls. I keep getting an error in the Event Viewer on the Epicor server that says:

              Order has been shipped, cannot add.

Even though, the transfer order that I’m using in the JSON that I’d passed in is clearly not shipped and I’m able to manually add transfer order lines within Epicor to the same transfer order.

Has anyone run into this before or can offer any suggestions?

Thanks

I am still gun shy on some of the REST mapping so usually have an issue reproduced in BLTester first. Can you hit the same method (UpdateExt?) on the TransferOrderEntrySvc and see if you can isolate it as a BO issue or a REST issue?

Yes, I can confirm calling POST on TransferOrderEntries (UpdateExt) works and does create a Transfer Order in Epicor. However, I’m just not able to create any order lines using REST.

As an added note, I’ve also tried adding customer shipments and shipment lines through REST and both worked as expected without any issues.

Thanks.

Example url and payload that is failing?

URL = https:///api/v1/Erp.BO.TransferOrderEntrySvc/TFOrdDtls
JSON (I’ve tried setting RowMod to U, A, and blank) =

{
“Company”: “13”,
“TFOrdNum”: “TSF1234”,
“TFOrdLine”: 0,
“OpenLine”: true,
“PartNum”: “100000”,
“OurStockQty”: “10”,
“SellingQty”: “10”,
“WarehouseCode”: “03”,
“Plant”: “A”,
“ToPlant”: “B”,
“OrderFirm”: true,
“ManualOrder”: true,
“ShipViaCode”: “FDEG”,
“TFLineNum”: “”,
“NeedByDate”: “2017-11-30T22:23:08.860Z”,
“RequestDate”: “2017-11-17T22:23:08.860Z”,
“Shipped”: false,
“StockTrans”: true,
“StagingWarehouseCode”: “03”,
“StagingBinNum”: “BinA”,
“FirmUser”: “”,
“OurStockQtyUOM”: “ea”,
“SellingQtyUOM”: “ea”,
“SelectForPicking”: false,
“LinkToContract”: false,
“TransferContractID”: “”,
“TransferLinkToContract”: false,
“CreateOrder”: false,
“LineStatus”: “Open”,
“Selected”: false,
“ThisOrderInvtyQty”: “10”,
“ShipViaCodeDescription”: “FED EX GROUND”,
“PartDescPricePerCode”: “E”,
“PartDescTrackSerialNum”: false,
“PartDescPartDescription”: “Part A”,
“PartDescTrackDimension”: false,
“PartDescSalesUM”: “ea”,
“PartDescIUM”: “ea”,
“PartDescSellingFactor”: “1.00000000”,
“PartDescTrackLots”: true,
“InvtyUOM”: “ea”,
“AvailSerialNumbers”: false,
“FirmDate”: “2017-11-17T22:23:08.860Z”,
“FromPlantDesc”: “Plant A”,
“ToPlantDesc”: “Plant B”,
“StageWhseCodeDescription”: “Warehouse 03”,
“WarehouseCodeDescription”: “Warehouse 03”,
“RowMod”: “A”
}

Error =

Epicor.RESTApi.ErrorHandling.ApiException: Order has been shipped, cannot add.

at Epicor.RESTApi.DataSources.IceServiceCaller.UpdateItem(TypeData typeData, ContextInfo context, IceTableset updExtDs) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\DataSources\IceServiceCaller.cs:line 151
at Epicor.RESTApi.ODataHelpers.v3.DataSourceProvider.Update(TypeData typeData, ContextInfo context, IEdmEntityObject entity) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\ODataHelpers\v3\DataSourceProvider.cs:line 197
at Epicor.RESTApi.ODataHelpers.v3.DataSourceProvider.Create(TypeMapping typeMapping, ContextInfo context, IEdmEntityObject entity, IEdmType edmType, IQueryOptions options) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\ODataHelpers\v3\DataSourceProvider.cs:line 107
at Epicor.RESTApi.Controllers.HandleOdatav3Controller.Post(IEdmEntityObject entity, ODataPath odataPath) in c:_Releases\ICE\3.1.600.0\Source\Framework\Epicor.RESTApi\Controllers\HandleOdatav3Controller.cs:line 171
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.HttpServer.d__0.MoveNext()

hello @NickTu where u able to resolve this issue ? , We are also facing the same currently.

Hello @Bart_Elia , we are also facing this similar issue , any inputs on this .

Hi @NickTu did you ever resolve this issue, @Bart_Elia won’t be able to help anymore i think…

Another bump to this thread in the hope that someone has cracked it - im getting this issue also

To add a bit more info this seems related to the TFLineNum field - it seems to demand a valid record number even when trying to add a line.

TFOrdDtls are strange in that there is a TFOrdNum for the header, a TFOrdLine which works much like the other tables with headers and details (1,2,3,etc) and then this additional field of TFLineNum which looks to be unique within the TFOrdDtl table.

Wonder if that difference has tripped up a developer somewhere when creating the REST api? Id expect to be able to leave both TFOrdLine and TFLineNum blank/0 (ones a string, ones an integer) and have both generated when creating a new record…but that doesnt seem to want to work.

worked around this by doing a POST to RPC Erp.BO.TransferOrderEntrySvc/Update

1 Like

Found a way around this error using Erp.BO.TransferWorkBenchSvc to add the line information.
I found the following fields needed as a minimum
{
“Company”: “string”,
“TFOrdNum”: “string”,
“TFOrdLine”: 0,
“PartNum”: “string”,
“OurStockQty”: “0”,
“Plant”: “string”,
“ToPlant”: “string”,
“NeedByDate”: “2021-12-09T11:19:04.970Z”,
“OurStockQtyUOM”: “string”,
“SellingQtyUOM”: “string”,
“SellingQty”: “0”,
“ShipViaCode”: “string”
}

I needed to manually set TFOrdLine for each line else multiple Line 0 were created with unique TFLineNum auto created.