Dear Experts
I’m trying import txt file using NAS. NAS throws the Call back error while using the standard SlientUpload function. I have tried in RTC Client for importing the file, NAV repeatedly asked confirmation dialog to access the File every time in a new NAV session. I have overcome the confirmation dialog using the “ServicePrincipalNameRequired” = true in the user ClientUserSetting. After this setting it stopped asking confirmation in RTC Client. But It seems the same confirmation is comes in the NAS too. This was reason for error in the NAS Import. I have tried to create SPN for the Domin user. Any special setup is required in Config file for this? Any suggestion is highly appreciated.
The below message for Event Log
The Microsoft Dynamics NAV Application Server session has failed. Reason: Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException
SuppressMessage: False
FatalityScope: None
Message: Microsoft Dynamics NAV Application Server attempted to issue a client callback to create a DotNet object: System.IO.File (CodeUnit 419 File Management). Client callbacks are not supported on Microsoft Dynamics NAV Application Server.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateDotNetHandle(String assemblyFullName, String typeName, Guid formHandle, String varName, Boolean createInstance, Object[] arguments)
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.CheckTypeIsLoaded()
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeStaticMethod[T](String methodName, UInt32 methodIndex, Object[] arguments)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent(NavText clientFilePath)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit58141.OnRun_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit58141.OnRun(INavRecordHandle εrec)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit59000.OnRun_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit59000.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.Runtime.NavApplicationServer.InternalStartNas(Object config)
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088
Thanks in advance
0
Comments
I'm also facing the same issue. Can you please let me know the Navision 2013 Build that you are using?
Thanks.
I have created simple CU with two lines of Code
FileName := 'C:\T1\T.TXT';
FileName2 := FileMgt.UploadFileSilent(FileName);
I have executed this CU through NAS
The File didn't uploaded and below error logged in Event Viewer. I hope many people have already tried File Import in NAS.
What I'm missing here ?
Server instance: DynamicsNAV70
Session type: Nas
Session ID: 1
The Microsoft Dynamics NAV Application Server session has failed. Reason: Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException
SuppressMessage: False
FatalityScope: None
Message: Microsoft Dynamics NAV Application Server attempted to issue a client callback to create a DotNet object: System.IO.File (CodeUnit 419 File Management). Client callbacks are not supported on Microsoft Dynamics NAV Application Server.
StackTrace:
at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateDotNetHandle(String assemblyFullName, String typeName, Guid formHandle, String varName, Boolean createInstance, Object[] arguments)
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.CheckTypeIsLoaded()
at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeStaticMethod[T](String methodName, UInt32 methodIndex, Object[] arguments)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.UploadFileSilent(NavText clientFilePath)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit419.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60001.OnRun_Scope.OnRun()
at Filter.InvokeWithFilter(NavMethodScope )
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit60001.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)t
at Microsoft.Dynamics.Nav.Runtime.NavApplicationServer.InternalStartNas(Object config)
Source: Microsoft.Dynamics.Nav.Ncl
HResult: -2146233088
I also got same error in my local system too
The upload function reads a file from your client computer to the server. But when the code is executed from the NAS, there is no client - the dotnet exception also mentions that call-backs to the client is not possible - because there is no client.
So if you intend to read the server's file directory, e.g. C:\temp\a.xml, then just read it as is. You haven't listed the exact scenario, but if it e.g. was an XML document, you would just write something like xmldom.load('C:\temp\a.xml'); or if it is something else, you can read it with a file variable: MyFile.OPEN('C:\temp\a.xml');
Microsoft - Dynamics NAV
Microsoft Dynamics NAV Consultant
Jatin's Blog