Options

Access local files with RTC

PloegPloeg Member Posts: 70
edited 2012-02-22 in NAV Three Tier
Hello guru's!

To import a XML-file with a XMLPort we use codeunit Common Dialog Management to select a file.

When we run the codeunit in classic there is no problem importing the file which we store on my desktop. But when I run the codeunit in the RTC, the import fails because it can't find the specified path. I understand that the RTC tries to access the given path in its own environment: the service tier.

So the classic client accesses the local machine -> C:\Users\BlaBlah\ImportFile.xml but the RTC tries to access the service tier -> C:\Users\BlaBlah\ImportFile.xml

Stupid RTC. Y U NOT use local settings?!

My question: how can I make the RTC to use my local file path instead of the service tier file path?

Answers

  • Options
    geronimogeronimo Member Posts: 90
    you can check the codeunit 419 3-Tier Automation Mgt.
    I haven't used this myself so far but it seems to do what is needed.
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    If you are in NAV 2009 R2 you could try with .NET Interop.
    take a look to this:
    http://blogs.msdn.com/b/nav/archive/201 ... 09-r2.aspx
    ~Rik~
    It works as expected... More or Less...
  • Options
    PloegPloeg Member Posts: 70
    Thanks for all the replies. I just had some time to look at this issue again.

    I stole the code from Report Import Profiles (9172), just like Mohana said. It works like a charm.
    The function UPLOAD transfers the local file to a tmp-folder on the service tier, from there I can import it. NICE!
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Ploeg wrote:
    Thanks for all the replies. I just had some time to look at this issue again.

    I stole the code from Report Import Profiles (9172), just like Mohana said. It works like a charm.
    The function UPLOAD transfers the local file to a tmp-folder on the service tier, from there I can import it. NICE!

    Great :thumbsup:
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Ploeg wrote:
    Thanks for all the replies. I just had some time to look at this issue again.

    I stole the code from Report Import Profiles (9172), just like Mohana said. It works like a charm.
    The function UPLOAD transfers the local file to a tmp-folder on the service tier, from there I can import it. NICE!

    Nice solution thanks Mohana and Ploeg for sharing.
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.