Bizarre error coming from the TransOrderReceiptSvc

Good Evening,
After building our complete dataset through a variety of other methods we finally call the TransOrderReceiptSvc.Custom Update method.

When running this we get an error stating: "Function not allowed"
at Erp.Services.BO.TransOrderReceiptSvc.TFShipDtlBeforeUpdate() in c:_Releases\ERP\UD10.1.400.16\Source\Server\Services\BO\TransOrderReceipt\TransOrderReceipt.cs:line 2503
at Ice.Services.Trace.TablesetProfilingCollector.DoRowEventTrace(String tableName, String methodName, Int32 rowCount, Action action) in c:_Releases\ICE\3.1.400.16\source\Framework\Epicor.Ice\Services\TablesetProfilingCollector.cs:line 146
at Ice.TablesetBound3.UpdateRow(IceDataContext dataContext, Int32 tableNum, IIceTable table, IceRow updatedRow, IceRow originalRow, TablesetProfilingCollector parentTraceCollector) in c:\_Releases\ICE\3.1.400.16\source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1155 at Ice.TablesetBound3.WriteTable(IceDataContext dataContext, Int32 tableIndex, IIceTable table, TablesetProfilingCollector parentTraceCollector) in c:_Releases\ICE\3.1.400.16\source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 893
at Ice.TablesetBound3.InnerUpdate(IceDataContext dataContext, TFullTableset tableset) in c:\_Releases\ICE\3.1.400.16\source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 796 at Erp.Services.BO.TransOrderReceiptSvc.Update(TransOrderReceiptTableset& ds) in c:\_Releases\ERP\UD10.1.400.16\Source\Server\Services\BO\TransOrderReceipt\TransOrderReceipt.Designer.cs:line 1534 at Erp.Services.BO.TransOrderReceiptSvc.CustomUpdate(TransOrderReceiptTableset& ds, String& opLegalNumberMessage) in c:\_Releases\ERP\UD10.1.400.16\Source\Server\Services\BO\TransOrderReceipt\TransOrderReceipt.cs:line 798 at Erp.Services.BO.TransOrderReceiptSvcFacade.CustomUpdate(TransOrderReceiptTableset& ds, String& opLegalNumberMessage) in c:\_Releases\ERP\UD10.1.400.16\Source\Server\Services\BO\TransOrderReceipt\TransOrderReceiptSvcFacade.cs:line 410 at SyncInvokeCustomUpdate(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in c:_Releases\ICE\3.1.400.16\source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in c:\_Releases\ICE\3.1.400.16\source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28 at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in c:\_Releases\ICE\3.1.400.16\source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.InnerTryReceiveCompletedCallback(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.Runtime.InputQueue1.AsyncQueueReader.Set(Item item)
at System.Runtime.InputQueue1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread) at System.Runtime.InputQueue1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.OnRead(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Web.Hosting.AsyncResultBase.Complete(Int32 hresult, Boolean synchronous)
at System.Web.Hosting.PipelineRuntime.AsyncCompletionHandler(IntPtr rootedObjectsPointer, Int32 bytesCompleted, Int32 hresult, IntPtr pAsyncCompletionContext)```


We wondered why the TFShipDtlBeforeUpdate() was being called. Upon further inspection (a good decomp of the transorderreceipt.dll) we found the following:

private void TFShipDtlBeforeUpdate()

{

((ContextBoundBase<ErpContext>) this).get_ExceptionManager().AddBLException(Strings.ThisFunctionIsNotAllowed, “TFShipDtl”);

}

Is this a bug? Why would this method be called in the main bo and not do anything except throw some generic error message?

Have you tried used UpdateExt (or Update) instead of CustomUpdate?

Yes. We tried all of the updates and all return the same error. :frowning:

Are you calling preUpdate as well?

We are. Here is an overview of the steps:

  1. GetByID(packNum) works fine
  2. PreUpdate(ref tableset) works fine too
  3. Updating: TFShipDtl.RowMod = ”U” and TFShipDtl.Received = True
  4. Updating: PlantTran fields RowMod = “U”, WarehseCodeTo, RecEntryPerson,RecTranDate, PartTranPKs and TranStatus
  5. CustomUpdate(ref tableset) throws the following error…
  • This function is not allowed. Method: TFShipDtlBeforeUpdate

I honestly have no idea what PreUpdate does, but are you sure you call it before you actually make the changes to the dataset?

Yes I’m sure we are. I just don’t know why tfship dtl before update would even be called within this method :laughing:

Lol ok i could have worded that one better. Are you sure you are supposed to call it before actually changing the ds?

You need to understand the Server Framework. Nearly all of the “Standard” methods are implemented by the Framework so the way that an Application coder can “do stuff” during the standard method calls is to Implement “Before” and “After” handlers.

In the case of an Update the Framework implements the TableNameUpdate behavior and the Apps Coders will implement the TableNameBeforeUpdate and/or TableNameAfterUpdate methods in the Server code if any application code is needed in those timings.

In the case of this business object, the Apps Coders are explicitly blocking any direct update to the TFShipDtl table. They have added code to “disallow” GetNew, Delete, and Update on that table. From a quick look at the code, it appears they are attempting to keep several tables in-sync (some comment about updating TFOrdDtl RecievedQty ??) so you will need to find the proper BO or Method to do the update you are attempting.

On this BO the PreUpdate and CustomUpdate both deal with Legal Number management - it doesn’t look like those methods do anything else.

2 Likes

Hi Jeff,

did you finally solve this problem ?

For posterity, the root cause of this error is mentioned here: REST - Transfer Order Receipt - #25 by NWhitall

In short to answer the root cause for this 3.5 year old post: Do not set the rowmod on TFShipDtl. Perform a buffer copy of the PlantTran row before modifying the fields and setting rowmod to U on only the new PlantTran row.