Need some help.
We are getting the following error:
Server Side Exception
BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
Exception caught in: Epicor.ServiceModel
Error Detail
Description: BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
Program: Erp.Services.BO.ARInvoice.dll
Method: InvcDtlBeforeUpdate
Line Number: 14184
Column Number: 13
Original Exception Type: NullReferenceException
Server Trace Stack: at Erp.Services.BO.ARInvoiceSvc.InvcDtlBeforeUpdate() in C:_Releases\ERP\UD10.2.200.23\Source\Server\Services\BO\ARInvoice\ARInvoice.cs:line 14184
at Ice.Services.Trace.TablesetProfilingCollector.DoRowEventTrace(String tableName, String methodName, Int32 rowCount, Action action) in C:_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Services\TablesetProfilingCollector.cs:line 144
at Ice.TablesetBound3.UpdateRow(IceDataContext dataContext, Int32 tableNum, IIceTable table, IceRow updatedRow, IceRow originalRow, TablesetProfilingCollector parentTraceCollector) in C:\_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 1279 at Ice.TablesetBound
3.WriteTable(IceDataContext dataContext, Int32 tableIndex, IIceTable table, TablesetProfilingCollector parentTraceCollector) in C:_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 997
at Ice.TablesetBound3.InnerUpdate[TUpdater](IceDataContext dataContext, TFullTableset tableset) in C:\_Releases\ICE\RL3.2.200.0\Source\Framework\Epicor.Ice\Services\TablesetBound.cs:line 900 at Erp.Services.BO.ARInvoiceSvc.Update(ARInvoiceTableset& ds) in C:\_Releases\ERP\UD10.2.200.23\Source\Server\Services\BO\ARInvoice\ARInvoice.Designer.cs:line 4233 at Erp.Services.BO.ARInvoiceSvcFacade.Update(ARInvoiceTableset& ds) in C:\_Releases\ERP\UD10.2.200.23\Source\Server\Services\BO\ARInvoice\ARInvoiceSvcFacade.cs:line 9613 at Epicor.Customization.Bpm.BO13CD3D75C253472D912321576BF67A33.GetListPreProcessingDirective_Update_DTD_Misc_Charge_on_Partial_Shipments_A7ABAEED89684CC6AF1D1CE44BE7E7D3.A001_CustomCodeAction() at Epicor.Customization.Bpm.BO13CD3D75C253472D912321576BF67A33.GetListPreProcessingDirective_Update_DTD_Misc_Charge_on_Partial_Shipments_A7ABAEED89684CC6AF1D1CE44BE7E7D3.ExecuteCore() at Epicor.Customization.Bpm.DirectiveBase
3.Execute(TParam parameters) in C:_Releases\ICE\ICE3.2.200.23\Source\Server\Internal\Lib\Epicor.Customization.BPM\DirectiveBase.Generic.cs:line 147
Client Stack Trace
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.ARInvoiceImpl.GetList(String whereClause, Int32 pageSize, Int32 absolutePage, Boolean& morePages)
at Erp.Adapters.ARInvoiceAdapter.OnGetList(String whereClause, SearchOptions opts, Boolean& MorePages)
at Ice.Lib.Framework.EpiBaseAdapter.GetList(SearchOptions opts, Boolean& morePages)
at Ice.Lib.Searches.EpiSearchEngine.GetSearchResultsFromAdapterMethod(SearchOptions opts, SearchDataSetMode sdsMode)
at Ice.Lib.Searches.EpiSearchEngine.SearchUsingAdapterMethod(SearchOptions options)
at Ice.Lib.Searches.EpiSearchEngine.SearchIt(SearchOptions options, DataSet& results, Boolean& usedAdapter)
at Ice.Lib.Searches.EpiSearchEngine.SearchIt(SearchOptions options)
at Ice.Lib.Framework.EpiBaseAdapter.InvokeSearch(SearchOptions opts)
at Erp.Adapters.ARInvoiceAdapter.InvokeSearch(SearchOptions opts)
at Erp.UI.App.ARInvoiceEntry.Transaction.invGetList(String groupID)
Inner Exception
Object reference not set to an instance of an object.
With the code below:
var ARInvSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.ARInvoiceSvcContract>(Db);
var ds = new Erp.Tablesets.ARInvoiceTableset();
foreach (int Invoice in InvoiceList)
{
using (var txScope = IceDataContext.CreateDefaultTransactionScope())
{
ds = ARInvSvc.GetByID(Invoice);
foreach (var id in (from i in ds.InvcDtl where i.SellingShipQty != i.SellingOrderQty select i))
{
if (id != null)
{
var ID_Row = id;
ID_Row.RowMod = IceRow.ROWSTATE_UPDATED;
ARInvSvc.OnChangeofLineDiscAmt(ID_Row.InvoiceNum, ID_Row.InvoiceLine, 10, ref ds);
Epicor.Customization.Bpm.InfoMessage.Publish("InvcDtl.RowMod = " + ID_Row.RowMod.ToString() + ". ");
The assignment of RowMod is giving us the error. Can someone please help us with this issue?
Thanks in advance