aRecordVar.FINDFIRST; recref.open(DATABASE::TableName); recref.SETPOSITION(aRecordVar.GETPOSITION); recref.FINDFIRST;
Type: System.ArgumentException Message: An item with the same key has already been added. StackTrace: at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Microsoft.Dynamics.Nav.Runtime.NCLMetaTable.<TryGetFieldByCaption>b__e(Int32 lcid) at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) at Microsoft.Dynamics.Nav.Runtime.NCLMetaTable.TryGetFieldByCaption(String name, NCLMetaField& result) at Microsoft.Dynamics.Nav.Runtime.NCLMetaTable.FindFieldMatch(String fieldIdentifier, Boolean prefixFallback) at Microsoft.Dynamics.Nav.Runtime.TableFilterResolver.AddFilter(String fieldName, NCLMetaFilterType filterType, String expressionString) at Microsoft.Dynamics.Nav.Runtime.TableViewParser.ProcessWhere(String input, Match match, TableFilterResolver resolver) at Microsoft.Dynamics.Nav.Runtime.RecordImplementation.SetPosition(String position) at Microsoft.Dynamics.Nav.Runtime.NavRecord.ALSetPosition(String position) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit61800.OnRun_Scope.OnRun() at Filter.InvokeWithFilter(NavMethodScope ) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit61800.OnRun(INavRecordHandle εrec) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record) at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.InvokeRun(Int32 objectId, Object[] args) at Microsoft.Dynamics.Nav.Service.NSCodeUnit.RunCodeunit(CodeUnitResponse codeUnit) at Microsoft.Dynamics.Nav.Service.NSCodeUnit.Invoke() at SyncInvokeInvokeApplicationMethod(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) Source: mscorlib HResult: -2147024809
Answers
I've tested your code with GLSetup and works fine with Codeunits in NAV 2013 R2 W1.
Greetings
Thanks for testing it out.
This error seems to be happening with some but not all tables, still trying to find some commonality between them.
Dan.
Hi
I tested a NAV2013r2 Italian database and this works fine:
Matteo
mmm One question...
Try "GETPOSITION(FALSE);" instead of "GETPOSITION;"
I think you have a custom table with 2 field with different names but same caption.
can it be?
Matteo
I created a new custom table with 2 fields with different names but same italian caption (no ENU caption).
If i set my language to Italian:
GETPOSITION(TRUE) RTC client will crash.
GETPOSITION(FALSE) works.
If i set English it works both true or false parameter.
very nice!
Matteo
You cracked it! Nice one Matteo!
GETPOSITION(FALSE) sorted the issue =D>