Error Checking in part on Eng workbench

anyone know what this error means?

Application Error

Exception caught in: Epicor.ServiceModel

Error Detail

Message: The cast to value type ‘System.Guid’ failed because the materialized value is null. Either the result type’s generic parameter or the query must use a nullable type.
Program: Epicor.ServiceModel.dll
Method: ShouldRethrowNonRetryableException

Client Stack Trace

at System.Data.Entity.Core.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader1.GetValue(DbDataReader reader, Int32 ordinal) at lambda_method(Closure , Shaper ) at System.Data.Entity.Core.Common.Internal.Materialization.Coordinator1.ReadNextElement(Shaper shaper)
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper1.SimpleEnumerator.MoveNext() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source)
at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TArg2,TArg3,TArg4,TArg5,TResult](TArg0 arg0, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5)
at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass37_17.<Compile>b__3(TContext c, Func7 query) in C:_Releases\ICE\ICE3.2.200.6\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1207
at Epicor.Data.DBExpressionCompiler.GetResult[TContext,TQuery,TResult](Func3 executeQuery, Cache cacheSetting, TContext dataContext, TQuery query) in C:\_Releases\ICE\ICE3.2.200.6\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 447 at Epicor.Data.DBExpressionCompiler.InvokeSingle[TContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TContext dataContext, Func2 getDataCacheKey, Func2 compileQuery, Func3 executeQuery) in C:_Releases\ICE\ICE3.2.200.6\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 306
at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass37_07.<Compile>b__0(TContext context, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5) in C:\_Releases\ICE\ICE3.2.200.6\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1200 at Erp.Internal.BM.BMM10_GD.FindFirstPartMtlSysRowID(String company, String partNum, String revisionNum, String altMethod, Int32 mtlSeq) in c:\_Releases\ERP\RL10.2.200.0\Source\Server\Internal\BM\EngWBLib\BMM10-GD.i.Queries.cs:line 327 at Erp.Internal.BM.BMM10_GD.CopyECOAttachments(String ipECOGroupID, String ipECOPartNum, String ipECORevisionNum, String ipECOAltMethod) in c:\_Releases\ERP\RL10.2.200.0\Source\Server\Internal\BM\EngWBLib\BMM10-GD.i.cs:line 4616 at Erp.Internal.BM.BMM10_GD.CheckInRev(ECORev aECORev) in c:\_Releases\ERP\RL10.2.200.0\Source\Server\Internal\BM\EngWBLib\BMM10-GD.i.cs:line 3098 at Erp.Internal.BM.BMM10_GD.CheckInAll(String ipGroupID, String ipAuditText, String& cResultsString) in c:\_Releases\ERP\RL10.2.200.0\Source\Server\Internal\BM\EngWBLib\BMM10-GD.i.cs:line 713 at Erp.Services.BO.EngWorkBenchSvc.CheckInAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, Nullable1 ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts, Boolean ipValidPassword, String ipAuditText, String& opResultString) in C:_Releases\ERP\UD10.2.200.6\Source\Server\Services\BO\EngWorkBench\EngWorkBench.cs:line 8399
at Erp.Services.BO.EngWorkBenchSvcFacade.CheckInAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, Nullable1 ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts, Boolean ipValidPassword, String ipAuditText, String& opResultString) in C:\_Releases\ERP\UD10.2.200.6\Source\Server\Services\BO\EngWorkBench\EngWorkBenchSvcFacade.cs:line 2390 at SyncInvokeCheckInAll(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\ICE3.2.200.6\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:_Releases\ICE\ICE3.2.200.6\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 47
at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:_Releases\ICE\ICE3.2.200.6\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 Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Erp.Proxy.BO.EngWorkBenchImpl.CheckInAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, Nullable1 ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts, Boolean ipValidPassword, String ipAuditText, String& opResultString)
at Erp.Adapters.EngWorkBenchAdapter.CheckInAll(String ipGroupID, String ipPartNum, String ipRevisionNum, String ipAltMethod, DateTime ipAsOfDate, Boolean ipCompleteTree, Boolean ipReturn, Boolean ipGetDatasetForTree, Boolean ipUseMethodForParts, Boolean ipValidPassword, String ipAuditText, String& opResultString)

1 Like

just posting the fix.
Epicor support pointed out this error is caused by there being a record on the attachment table but no part, op, mtl , rev linked to it. so its an orphan attachment record.
they provided a fix.

1 Like

What fix did they provide? I just ran into the same error on two methods.

Not positive but I think there was a knowledgebase article on Epicare

The way I was able to clear errors and check in revsions
1.) Built a BAQ to identify “bad” XfileAttch.Key5
WHERE RelatedToFile = ECOMtl and there was no matching ECOMtl.MtlSeq
OR
RelatedToFile = ECOOpr and no matching ECOOpr.OprSeq
2.) Then in Engineering Workbench
Add “dummy” MtlSeq(s) per each of the “bad” records found in step 1
(any part number should work)
Then save to triggers an update/correction in the XFileAttch table
Then remove “dummy” MtlSeq(s)
save again
Then you should be able to check in your revision

A pain the neck since I had a LOT of bad XFileAttch records but… these steps did fix the problem

If I remember, the attachments problems arose after reordering methods.

4 Likes

Thank you! we’ll give it a shot!

@Mike_M We had an issue like this and get the fix below from support.

FX_Del_XFileAttch_ECO

Remove XFileAttch when RelatedToFile is ECORev, or ECOOpr, or ECOMtl, and corresponding record not found in PartOpr, PartMtl, and PartRev

image

I also used Attachment Path Maintenance to cleanup some issues.

Hey thanks so much, this was issue we had happen yesterday. SQL for others:

select * from ice.XFileAttch where
key1 = '19202'        --ECO group giving error
and key2 = '173-150'  --Part giving error that won't check in

Here is example of error. Notice there is no Op 40.


image

Fix per @bordway 's instructions above.

I had the same exact error - but a simple right click on Material and “Resequence” fixed the problem.