Server Side Error - BPM runtime caught an unexpected exception

We got the following error. Anyone can help and provide suggestion? Which BPM (name) causes this issue? Thanks.

Server Side Exception

BPM runtime caught an unexpected exception of ‘EntityCommandExecutionException’ 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 ‘EntityCommandExecutionException’ type.
See more info in the Inner Exception section of Exception Details.
Inner Exception: Invalid column name ‘SPEmailAddr_c’.
Program: System.Data.Entity.dll
Method: ExecuteStoreCommands
Original Exception Type: EntityCommandExecutionException
Framework Method: A001_CustomCodeAction
Framework Line Number: 0
Framework Column Number: 0
Framework Source: A001_CustomCodeAction at offset 1065 in file:line:column :0:0

Server Trace Stack: at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery1.GetResults(Nullable1 forMergeOption)
at System.Data.Objects.ObjectQuery1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at Epicor.Customization.Bpm.BO4EB9FEAE25BC4061AB4D8D49FA4C6B62.UpdatePreProcessingDirective_58_SupplierAutoIDPre_44BA6648A50748A6A54F8B3D272DF5AA.A001_CustomCodeAction()
at Epicor.Customization.Bpm.BO4EB9FEAE25BC4061AB4D8D49FA4C6B62.UpdatePreProcessingDirective_58_SupplierAutoIDPre_44BA6648A50748A6A54F8B3D272DF5AA.ExecuteCore()
at Epicor.Customization.Bpm.DirectiveBase`3.Execute(TParam parameters) in c:_Releases\ICE\3.1.500\Current\Source\Server\Internal\Lib\Epicor.Customization.Bpm\DirectiveBase.Generic.cs:line 160

Inner Trace:
Invalid column name ‘SPEmailAddr_c’.
: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.VendorImpl.Update(VendorDataSet ds)
at Erp.Adapters.VendorAdapter.OnUpdate()
at Ice.Lib.Framework.EpiBaseAdapter.Update()
at Erp.UI.App.VendorEntry.VendorTransaction.Update()

Inner Exception

An error occurred while executing the command definition. See the inner exception for details.

Inner Exception

Invalid column name ‘SPEmailAddr_c’.

Do you have a pre-processing directive named “Supplier Auto ID” on the Update method of the Vendor object?

Tyler,
Yes, we have one called SupplierAutoIDPre

But we cannot find the column SPEmailAddr_c in the Custom Code.

Did you recently add this column to the table? Even if you are not trying to access that column directly, you will sometimes get errors like this if you haven’t Regenerated the Data Model yet. Check UD Column Maintenance to make sure the Data Model is in sync with the database.

Some one else added one the column SPEmailAddr_c, I think.

Has someone created a new custom field (SPEmailaddr_c) without regenerating the data model?

Can I just remove the added column and fix this issue? The new column is not used.

Thanks. Yes, someone did it.

In my experience, if you have added a custom column and have not regenerated the database since creating it and you have not used the column in a UI customization, you can remove it. Alternatively, get everyone out and regnerate the database.

1 Like

Thanks a lot, Dan.

Hi Tyler,
Thanks a millions. How did you find it is Vendor business object from the BO4EB9…6B62?

In the “Client Stack Trace” part of the error message, it shows calls to the Vendor object.

Thanks a lot. I am trying to find the added column in Extended User Defined Table Maintenance and can find the invalid SPEmailAddress_c. It is weird.

Are there other tables related to Vendor that have UD fields? Or do you reference any other table in your custom code block?

In the custom code, only the UDcodes table, i think, cause this issue. But in UDCodes there is no SPEmailAddr_c and the UDCodes is not sync.

Are you saying that in Extended User Defined Table Maintenance, you have reviewed the custom columns in all tables and did not find SPEmailAddress_c in any table?

If you have SSMS access, a tool called ApexSQL Search will search and find columns with that name.

At the moment, I’m assuming that the column doesn’t actually exist in SQL, resulting in the Invalid Column Name error. If this is the case, then Apex SQL Search would not find the column.

Dan, you’re right.