Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

STARTSESSION File Import Error

Posted on by 895

Hi all,

I have the following error when file upload while using STARTSESSION. I have used UploadFileSilent function.

FileManagement.UploadFileSilent(ClientFilename);

Event viewer Error -->

Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException

Message: Microsoft Dynamics NAV 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 Server.

My requirement is to auto import file to multiple companies. so using STARTSESSION to change companies.


Please advise.

*This post is locked for comments

  • Suggested answer
    Anton Modaresi Profile Picture
    Anton Modaresi 100 on at
    RE: STARTSESSION File Import Error

    OK in my case that dot net object was running on client (property), so I fixed the issue programmatically. By the way, the task scheduler (job queue) in 2017 seems to handle calling functions in "pages" just fine.

  • Anton Modaresi Profile Picture
    Anton Modaresi 100 on at
    RE: STARTSESSION File Import Error

    Did you solve it? I have the same problem on NAV 2017 task scheduler:

    Microsoft Dynamics NAV Server attempted to issue a client callback to create a DotNet object: System.IO.File (CodeUnit 14000905 E-Mail Integration). Client callbacks are not supported on Microsoft Dynamics NAV Server.

    Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException
    
    SuppressMessage: False
    
    SuppressExceptionCreatedEvent: False
    
    FatalityScope: None
    
    Message: <ii>Microsoft Dynamics NAV Server attempted to issue a client callback to create an Automation object: 093ff999-1ea0-4079-9525-9614c3504b74 (Table 14000724 Computer User Setup). Client callbacks are not supported on Microsoft Dynamics NAV Server.</ii>
    
    StackTrace:
    
    at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateAutomationObject(Guid classId, String licenseKey, Boolean newServer)
    
    at Microsoft.Dynamics.Nav.Runtime.NavAutomation.Create(DataError errorLevel, Boolean newServer, Boolean clientSide)
    
    Source: Microsoft.Dynamics.Nav.Ncl
    
    HResult: -2146233088
    

    I have tried to login with the service user on the service instance and do it manually ( I did get the box to always allow) and I did set the ServicePrincipalNameRequired to true in ClientUserSettings.config both in %programdata% and in user appdata. Restarted the service. Have not found anything working.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: STARTSESSION File Import Error

    Did you run the action manually first by logging as the NAS user and select always allow for the components ?

  • aavio Profile Picture
    aavio 895 on at
    RE: STARTSESSION File Import Error

    Have updated the config setup based on the above link, but still same error. Have restarted nav server as well.

    Event viewer Error -->

    Session type: Background

    Type: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLCallbackNotAllowedException

    SuppressMessage: False

    SuppressExceptionCreatedEvent: False

    FatalityScope: None

    Message: Microsoft Dynamics NAV 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 Server.

    StackTrace:

        at Microsoft.Dynamics.Nav.Runtime.HeadlessClientCallback.CreateDotNetHandle(String assemblyFullName, String typeName, Guid formHandle, String varName, Boolean createInstance, Object[] arguments)

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: STARTSESSION File Import Error

    When ever you use external component it will ask the permission to run it and it has options to set always allow, can you run the process manually by logging as NAS/NAV server user and that should ask you the permission and set it to always allow then try to run the process automatically which should fix the issue.

    If you don't get always allow option check this below blog

    kauffmann.nl/.../nav-client-needs-permission-to-run-external-component

  • aavio Profile Picture
    aavio 895 on at
    RE: STARTSESSION File Import Error

    while manually running, no dialog box and Import is working.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: STARTSESSION File Import Error

    Try to run the function manually first and see if it is opening any dialog box, if the process opens any kind of dialog box when you use Job Queue then you get this kind of error you need to make sure to suppress all those dialog boxes.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans