Introduction:
Hello, Thanks for stopping by my blog.
Here, in this scenario I was trying to create an automation process (Job Queue) to import files into NAV using File Management functions Move and Delete.
This function works perfectly fine when triggered on a action button but when triggered on a Job queue it throws an Error: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.
Pre-requisites:
Microsoft Dynamics NAV
Original code
Reason for Error
- File Management functions Move uses Dot Net variable ClientFileHelper and properties as RunOnClient=Yes
- When you set the RunOnClient property to Yes, then the class instance that is defined by the variable is instantiated on the Microsoft Dynamics NAV Windows client.
- Job Queue does not support client call back from client on the server.
Resolution:
Re-code the move function of codeunit File management and set the property of Dot Net variable ClientFileHelper as RunOnClient=No
Final code:
Thanks for Reading!
*This post is locked for comments