We are currently doing our uplift from E9 to E10. I have used the migration tool to convert my ABL to C#. I already know that it is not perfect and should not be your production code. I am learning C# but can be considered very green.
Anyhow, I have a BAQ that utilizes UD102 and writes to UD102A for logging purposes. Works fantastic in 9. I am unsure how to insert a new row into the UD102A table. Here is the code the migration tool converted my ABL to. Can anyone help?
Do you have the Epicor ERP C# Programming Guide (conversion from ABL)? You can find it on Epicweb. It has examples about converting abl to c#. One particular example is how to write to a UD table.
I’m so close to figuring it out here. I now have the following just using strings for testing for now.
var UD102svc = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.UD102SvcContract>(Db);
var ds = new UD102Tableset();
UD102svc.GetaNewUD102A(ref ds);
ds.UD102A[0].Company = “GCB”;
ds.UD102A[0].Key1 = “KEY1”;
ds.UD102A[0].Key2 = “KEY2”;
ds.UD102A[0].Key3 = “KEY3”;
ds.UD102A[0].Key4 = “KEY4”;
ds.UD102A[0].Key5 = “KEY5”;
ds.UD102A[0].ChildKey1 = “CHILDKEY1”;
ds.UD102A[0].ChildKey2 = “CHILDKEY2”;
ds.UD102A[0].ChildKey3 = “CHILDKEY3”;
ds.UD102A[0].ChildKey4 = “CHILDKEY4”;
ds.UD102A[0].ChildKey5 = “CHILDKEY5”;
UD102svc.Update(ref ds);
However, syntax error says: CS7036 There is no argument given that corresponds to the required formal parameter ‘ParentKey1’ of ‘UD102SvcContract.GetaNewUD102A(ref UD102Tableset, string, string, string, string, string)’
Think of it like a Sales Order or Purchase Order. Your key field in the header (Sales Order Number) must exist before your details can be added. It’s the same for the UD##A tables. You must have record UD102 filled with Key1-Key5 (even if some are blank). Your UD102A Key1-Key5 MUST be identical to the UD102 Key1-Key5 or you’ll get this message.
Still a no go. Same error. It seems that UD102Asvc.GetaNewUD102A(ref ds); is requiring a parameter or parameters according to the error?
There is no argument given that corresponds to the required formal parameter ‘ParentKey1’ of ‘UD102SvcContract.GetaNewUD102A(ref UD102Tableset, string, string, string, string, string)’
That did it. Although now I get a server error. Bout done with this.
Server Side Exception
A server error occurred. Review the server event logs for details.
Exception caught in: Epicor.ServiceModel
Error Detail
Description: A server error occurred. Review the server event logs for details.
Program: Epicor.System.dll
Method: ProvideFault
Line Number: 32
Column Number: 13
Server Trace Stack: at Epicor.Hosting.Wcf.ErrorHandler.ProvideFault(Exception error, MessageVersion version, Message& fault) in C:_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Hosting\Wcf\ErrorHandler.cs:line 32
at System.ServiceModel.Dispatcher.ErrorBehavior.ProvideFault(Exception e, FaultConverter faultConverter, ErrorHandlerFaultInfo& faultInfo)
at System.ServiceModel.Dispatcher.ErrorBehavior.ProvideMessageFaultCore(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.ProcessError(Exception e)
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.Dispatch()
at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Client Stack Trace
at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Ice.Proxy.BO.DynamicQueryImpl.Update(DynamicQueryDataSet queryDS, DataSet queryResultDataset) at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass27_0.<Update>b__0(DataSet datasetToSend) at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func2 methodExecutor, Boolean refreshQueryResultsDataset)
at Ice.Adapters.DynamicQueryAdapter.Update(DynamicQueryDataSet queryDS, DataSet updatedDS, Boolean refreshQueryResultsDataset)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.b__380_0(Int32& rowReturned)
at Ice.UI.App.BAQDesignerEntry.Forms.BAQDiagramForm.ShowQueryResults(DataSet dsResults, getQueryResult getResults, ReportAdditionalInfo additionalInfo)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.CallUpdate()