Erp.Proxy.BO.CustomerImpl DeleteByID Method

I have this error using DeleteByID of Customer BO in Visual Studio.

Has someone solved the problems deleting records using proxy implementation?

Object reference not set to an instance of an object.
at Erp.Services.BO.CustomerSvc.CustomerBeforeDelete() in C:_Releases\ERP\UD10.1.600.9\Source\Server\Services\BO\Customer\Customer.cs:line 3947
at Ice.Services.Trace.TablesetProfilingCollector.DoRowEventTrace(String tableName, String methodName, Int32 rowCount, Action action) in C:_Releases\ICE\3.1.600.9\Source\Framework\Epicor.Ice\Services\TablesetProfilingCollector.cs:line 144
at Ice.TablesetBound3.DeleteRow(IceDataContext dataContext, String tableName, LinqRow dbRow, TablesetProfilingCollector parentTraceCollector) in C:\_Releases\ICE\3.1.600.9\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1307 at Ice.TablesetBound3.OnDeleteByID(String logicalTableName, LinqRow dbRow) in C:_Releases\ICE\3.1.600.9\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 817
at Erp.Services.BO.CustomerSvcFacade.DeleteByID(Int32 custNum) in C:_Releases\ERP\UD10.1.600.9\Source\Server\Services\BO\Customer\CustomerSvcFacade.cs:line 2209
at SyncInvokeDeleteByID(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func)
at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
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 Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.CustomerImpl.DeleteByID(Int32 custNum)
at ConsoleApplication3.Program.deletecustomer() in c:\Users\Jaicker\Documents\Visual Studio 2012\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 200

Not sure about that error (sorry) you could try just running a GetBYID loop through the dataset and Deletethe Rows and call Update

QuoteDataSet qds = _qa.GetByID(oTrans_adapter.QuoteData.QuoteHed[0].QuoteNum);

//For each Line in Our Data Set
foreach(QuoteDataSet.QuoteDtlRow dr in qds.QuoteDtl)
{
     //Delete it
     dr.Delete();
}
//Update the Data Set
_qa.Update(qds);
1 Like

That looks like a bug - please open a ticket with Support through proper channels. Until then, Jose’s suggestion is a good workaround

did work perfectly, thanks, @josecgomez. :+1:

I’m getting the same error in 10.2.100.8. @Jaicker_Avila, did you ever open a ticket on this?

I don’t think I’ll ever need to delete a customer through the REST API in production. I’m trying to delete a customer that a was created by a unit test. I’ll try Jose’s suggestion.