[Customization] Can't find reliable event updating drop down column filter

I have a drop down. Its filtered based on another field:

epiComboC1.Rows.ColumnFilters["ShortChar01"].FilterConditions.Clear();      epiComboC1.Rows.ColumnFilters["ShortChar01"].FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Equals,cmbISBHook1Shape.Value.ToString());

The filter works fine by itself, but it doesn’t update when switching records. First I tried having the filter update on AfterFieldChanged, but that did not update filter when switching between records. I’ve also tried the ValueChanged event on the actual drop down control.

Right now I have a combination of DataView_ListChanged and ValueChanged, it works sometimes, but once you have switched to a record more than once it stops updating.

What is is the correct way to do this?

Did I explain what my issue was poorly, or is this actually a difficult thing to do? :cry:

It may depend on the particular circumstances …

We do this quite a lot, but ours is almost always on a row change in some EpiDataView rather than a field change as such. It seems to work reliably doing that. Stupid question, from what you’ve written, it reads as though you’re updating the dropdown based on values changing in the same field it’s bound to - presumably you are using the events on the field you want?

We do use the SearchFilter rather than the ColumnFilters, as well, and I suppose it’s possible that is more reliable to update.

Row change in EpidDataView seemed to work fine when actual changes were made, but it didn’t seem to fire when switching records with these controls at the top:
image

I’m not using SearchFilters because they gave me errors.

That looks like it should be triggering an EpiViewNotification rather than a RowChange? Maybe you need to capture both.

Is the combo you are filtering from bound? If so why not use the epifilters to automatically filter based on a other field?

Wait, you can use EpiBindings from another control in the filters?

Sure thing
Se the EpiFilters property and or EpiFiltersParams

EpiFilters
PartNum = ‘?{PartNumColName}’
EpiFiltersParams
PartNumColName=?[PartNum]
1 Like

Ok, I must be doing something wrong…

Combo1: Bound to UD40View.ShortChar03 and choices are from UD Code
Combo2: Bound to UD40View.ShortChar05, choices are from UD code, except filters so that UDCode.ShortChar01 = UD40View.ShortChar03

Combo1:

Combo2:

Expand Error Message

Server Side Exception

A server error occurred. Review the server event logs for details.

Exception caught in: Epicor.ServiceModel

Error Detail

Correlation ID: b57fa1ca-bcbf-4ea6-8822-f05fcdb4df59
Description: A server error occurred. Review the server event logs for details.
Program: Epicor.System.dll
Method: ProvideFault
Line Number: 34
Column Number: 17
Server Trace Stack: at Epicor.Hosting.Wcf.ErrorHandler.ProvideFault(Exception error, MessageVersion version, Message& fault) in C:_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.System\Hosting\Wcf\ErrorHandler.cs:line 34
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.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
at System.Runtime.InputQueue1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread) at System.ServiceModel.Channels.SingletonChannelAcceptor3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)
at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)
at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.OnRead(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Web.Hosting.AsyncResultBase.Complete(Int32 hresult, Boolean synchronous)
at System.Web.Hosting.PipelineRuntime.AsyncCompletionHandler(IntPtr rootedObjectsPointer, Int32 bytesCompleted, Int32 hresult, IntPtr pAsyncCompletionContext)

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Ice.Proxy.Lib.BOReaderImpl.GetRows(String serviceNamespace, String whereClause, String columnList)
at Ice.Lib.Framework.EpiCombo.getDataSet()

So do a Trace and see what the filter you are passing in looks like it will tell you what you need to change.

<tracePacket>
  <businessObject>Ice.Proxy.Lib.BOReaderImpl</businessObject>
  <methodName>GetRows</methodName>
  <appServerUri>https://ausmtsapp01.epicorsaas.com/SaaS203/</appServerUri>
  <returnType>System.Data.DataSet</returnType>
  <localTime>11/1/2019 14:07:20:1818091 PM</localTime>
  <threadID>1</threadID>
  <correlationId>ce6bd1eb-2c9e-4b6f-882f-27f4ac4d2820</correlationId>
  <executionTime total="157" roundTrip="157" channel="0" bpm="0" other="0" />
  <retries>0</retries>
  <parameters>
    <parameter name="serviceNamespace" type="System.String"><![CDATA[Ice:BO:UserCodes]]></parameter>
    <parameter name="whereClause" type="System.String"><![CDATA[(CodeTypeID='HkThroats') AND (ShortChar01='UHook')]]></parameter>
    <parameter name="columnList" type="System.String"><![CDATA[]]></parameter>
  </parameters>
</tracePacket>

Looks like it should be working to me??

Looks fine hmmm odd.

…and your combo2 works fine without any EpiFilters and EpiFilterParams?

Well, its not filtered, but yes it displays values in the drop down and no errors appear.

Got the error from the cloud team, but it doesn’t clear anything up for me:

Long error message
<Op Utc="2019-11-08T18:01:23.9597786Z" act="Ice:Lib:BOReader/BOReaderSvcContract/GetRows" correlationId="a2f49eaa-d3f0-4ad1-a942-1bd6e9938162" dur="7.2782" cli="10.164.50.4:22477" usr="78863-epurdy" machine="AUSMTSAPPPRD02" pid="18736" tid="360">
  <IceAppServer msg="Server Side Error&#xD;&#xA;Server Side Exception&#xD;&#xA;EpicorServerException&#xD;&#xA;&#x9;Correlation ID: a2f49eaa-d3f0-4ad1-a942-1bd6e9938162&#xD;&#xA;&#x9;Description: Invalid column name 'ShortChar01'.&#xD;&#xA;&#x9;Program: Epicor.Ice.dll&#xD;&#xA;&#x9;Method: innerGet&#xD;&#xA;&#x9;Line Number: 633&#xD;&#xA;&#x9;Column Number: 21&#xD;&#xA;&#x9;Original Exception Type: SqlException&#xD;&#xA;&#x9;SQL Line Number: 2&#xD;&#xA;&#x9;SQL Error Number: 207&#xD;&#xA;&#x9;Server Trace Stack:    at Ice.Hosting.ServiceCaller.innerGet(MethodSpec plan, CallContext ctx, IceDataContext dataContext, Boolean isGenericOperation, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 633&#xD;&#xA;   at Ice.Hosting.ServiceCaller.Get(MethodSpec plan, CallContext ctx, IceDataContext dataContext, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 408&#xD;&#xA;   at Ice.Hosting.ServiceCaller.GetRows(IceDataContext dataContext, String boName, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 327&#xD;&#xA;   at Ice.Services.Lib.BOReaderSvc.GetRowsWithPaging(String serviceNamespace, String whereClause, Int32 pageSize, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReader.cs:line 107&#xD;&#xA;   at Ice.Services.Lib.BOReaderSvc.GetRows(String serviceNamespace, String whereClause, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReader.cs:line 92&#xD;&#xA;   at Ice.Services.Lib.BOReaderSvcFacade.GetRows(String serviceNamespace, String whereClause, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReaderSvcFacade.cs:line 246&#xD;&#xA;   at SyncInvokeGetRows(Object , Object[] , Object[] )&#xD;&#xA;   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;&#xA;   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59&#xD;&#xA;   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;" />
  <Exception><![CDATA[
Invalid column name 'ShortChar01'. (SqlException)
   at Ice.Hosting.ServiceCaller.innerGet(MethodSpec plan, CallContext ctx, IceDataContext dataContext, Boolean isGenericOperation, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 633
   at Ice.Hosting.ServiceCaller.Get(MethodSpec plan, CallContext ctx, IceDataContext dataContext, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 408
   at Ice.Hosting.ServiceCaller.GetRows(IceDataContext dataContext, String boName, String whereClause, Int32 pageSize) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.Ice\Hosting\ServiceCaller\ServiceCaller.cs:line 327
   at Ice.Services.Lib.BOReaderSvc.GetRowsWithPaging(String serviceNamespace, String whereClause, Int32 pageSize, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReader.cs:line 107
   at Ice.Services.Lib.BOReaderSvc.GetRows(String serviceNamespace, String whereClause, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReader.cs:line 92
   at Ice.Services.Lib.BOReaderSvcFacade.GetRows(String serviceNamespace, String whereClause, String columnList) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Server\Services\Lib\BOReader\BOReaderSvcFacade.cs:line 246
   at SyncInvokeGetRows(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func`2 func) in C:\_Releases\ICE\RL10.2.500.0FW\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
   at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func`2 func) in C:\_Releases\ICE\RL10.2.500.0FW\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\RL10.2.500.0FW\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)
]]></Exception>
</Op>

Support can’t seem to reproduce my error, would anyone be willing to test and see if they get an error?

Attached is a simple customization for UD20, with just two drop downs and no custom code. The Epifilters give me an error, but support doesn’t get the error. They do agree the filter does not work though.

I also attached the UDcodes in excel format, so you can add those to Epicor with the “Paste Insert” function.

Case0198UDCodes.xlsx (10.2 KB)

App.UD20Entry.UD20Form_Customization_Case0198Test_CustomExport.xml (36.0 KB)

With some secret help I have determined that the issue is the epifilter is looking for “ShortChar01” on the UDCodeType table and not the UDCodes table. Any idea how to work around this issue?

The UserCodes GetRows does:

Dictionary<IIceTable, string> tableWhereClauses = new Dictionary<IIceTable, string>();
tableWhereClauses.Add(CurrentFullTableset.UDCodeType, whereClauseUDCodeType);
tableWhereClauses.Add(CurrentFullTableset.UDCodes, whereClauseUDCodes);

Almost as if the ShortChar01 column - must exist on both, for it not to fail.

whereClauseUDCodeType: CodeTypeID=‘EpiTest2’
whereClauseUDCodes: ShortChar01=‘T1A’

That would get the right results, but it seems to be using the BOReader.GetRows and not the UserCodesSvc.GetRows, so the Epicombo doesn’t work…

Ok, I stepped back and thought about what I was trying to achieve. I have a limited number of sub-categories, so I was able to achieve a similar effect by deleting the searchfilter on my second combo and setting the following properties:
EpiFiltersParams:
HookShapeCol=?[ShortChar03]
EpiFilters:
CodeTypeID=‘?{HookShapeCol}Throat’

This works great when the record is first opened. But it doesn’t update if ShortChar03 is changed or if another record is opened. It seems to only evaluate the filter once. Thus I am right back at square one were I started this post…

Is it expected that the filter wouldn’t automatically “refresh” every time the other field changes?