Shared file accès on RTC

cmoihamidcmoihamid Member Posts: 4
edited 2012-02-29 in NAV Three Tier
Hello experts,

The payroll data for one of our clients are imported from a txt file in a general journal.
A codeunit was developed for this need.
The path to the file parameter from a page and stored in a table.


FilePath:="3tiers".DownloadTempFile(Config."Nom du fichier d'importation");
IF NOT EntryFile.OPEN(FilePath) THEN
ERROR(text01,Config."Nom du fichier d'importation");
The RTC returs everytime the error message

Delegates were configured
This works perfectly on the classic but not on the RTC.


Have you any idea?

The client configuration is:
- Windows 2008
- Dynamics Nav2009 R2
- SQL Server 2008
-- SQL Server and Dynamics NAV server are on the same server
-- RTC is on client

Thank you in advance

Answers

  • SogSog Member Posts: 1,023
    maybe one should wait until the transfer from server to local is complete.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • mdPartnerNLmdPartnerNL Member Posts: 802
    The DownloadTempfile is placing the file in a different location. Please browse thru you temp folder.
  • deV.chdeV.ch Member Posts: 543
    You want to import something right?
    Then you need to Upload the file, not download. Downloading means you Get something you have on the server like a file you created/writed (which happens on the service tier) to your client to open, or further process it.

    Now to import you need to go the other way round, you have a file that is on a path relative to your computer like: C:\temp\myfile, or a network share. You need to use the silent upload function of the 3-tier codeunit to do that then you can open it.

    If you don't have the silentupload function (i think is a DACH function) then here it is:
    // MagicPath Function --------------------------------------------------
    Magicpath() : Text[1024]
    EXIT('<TEMP>');   // MAGIC PATH makes sure we don't get a prompt
    
    // SilentUpload Function --------------------------------------------------
    SilentUpload(ClientFilePath : Text[1024];VAR ServerFilePath : Text[1024]) Status : Boolean
    // DACH0001.begin
    IF ISCLEAR(FileObject) THEN
      CREATE(FileObject, TRUE, TRUE);
    
    Ext := FileObject.GetExtensionName(ClientFilePath);
    ClientTempFilePath := ClientTempFileName('',Ext);
    ClientTempFile := FileObject.GetFileName(ClientTempFilePath);
    FileObject.CopyFile(ClientFilePath,ClientTempFilePath,TRUE);
    
    ServerFilePath := ServerTempFileName('',Ext);
    
    Status := UPLOAD('',Magicpath,'',ClientTempFile,ServerFilePath);
    
    // DACH0002.begin
    //IF FileObject.FileExists(ClientTempFilePath) THEN
    //  FileObject.DeleteFile(ClientTempFilePath);
    // DACH0002.end
    EXIT(Status);
    // DACH0001.end
    
  • cmoihamidcmoihamid Member Posts: 4
    Thank you verry much for the answers.
    I used the deV.ch's Code, i called the update fonction and that solved my problem.

    Best regards
  • CaponeCapone Member Posts: 125
    :thumbsup:

    Thank you for the silent upload tip! That was exactly what I was looking for.

    It was located in code unit 419. I think it is a standard functionality
    Hello IT, have you tried to turn it off and on?
    Have you checked the cables?
    Have you released the filters?

    http://www.navfreak.com
Sign In or Register to comment.