Options

The specified path is invalid

vandangvandang Member Posts: 101
edited 2013-09-12 in NAV Three Tier
Hello all,

I searched this error message on this forum but still cannot get the best solution. I got the message as above title when running the report to import the data on RTC client. This function worked fine on Server machine (both classic client and RTC) but client. Is it related to grant permission on client folder?

I work arround and if put the the file under C:\Users\Public. I will get the other error: "File C:\Users\Public\simple.txt was not found."

Thanks you for reading my threat!

Answers

  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    When you try to excute import function from client machine it will try to find the path given by you in servicetier installed machine.

    where is your file located? in clinet machine or servicetier installed machine?
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    In the RTC you should have specified if the file is handled by the Service Tier or the Client.

    Have you investigated that?

    http://msdn.microsoft.com/en-us/library/dd338837.aspx
  • Options
    vandangvandang Member Posts: 101
    When you try to excute import function from client machine it will try to find the path given by you in servicetier installed machine.

    where is your file located? in clinet machine or servicetier installed machine?

    Can you help me understand your idea about "the path given by you in servicetier installed machine". The file located in client machine.Thanks!
    In the RTC you should have specified if the file is handled by the Service Tier or the Client.

    Have you investigated that?

    http://msdn.microsoft.com/en-us/library/dd338837.aspx
    Please teach me how can specfied where the file is handled by the Service Tier or the Client, I tried following the link http://msdn.microsoft.com/en-us/library/dd338641.aspx, but I face to the other error message "You do not have permission to run the codeunit 50010". Thanks you!
  • Options
    yukonyukon Member Posts: 361
    Hi vandang,

    Pls check your license can access that range.

    Regards,
    Yukon
    Make Simple & Easy
  • Options
    vandangvandang Member Posts: 101
    yukon wrote:
    Hi vandang,

    Pls check your license can access that range.

    Regards,
    Yukon

    Thanks Yukon, the license works fine.

    mohana_cse06 and Mark Brummel are correct! I found out that RTC client just can see the file on the Servicetier machine only. My solution is request IT guy create a shared folder where all users can create and modify so users can import via RTC. Is there any better solution?!
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Even though the file is located in client machine, you can upload it to temp folder of servicetier machine and import..

    Check report 9172.. how they have have uploaded the file to servicetier machine..
  • Options
    vandangvandang Member Posts: 101
    Even though the file is located in client machine, you can upload it to temp folder of servicetier machine and import..

    Check report 9172.. how they have have uploaded the file to servicetier machine..

    Thanks mohana_cse06, it worked! The short code below help me :),
    IF ISSERVICETIER THEN
    BEGIN
      TempFile.CREATETEMPFILE;
      FileName := TempFile.NAME + '.xml';
      TempFile.CLOSE;
      IF UPLOAD(Text001, '',Text002,'',FileName) THEN
        [mycode to insert to table here]
      CurrReport.QUIT;
    END;
    
    One more query, if I use the the request form after select the correct file, it's still show the temporary txt file and path, C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\users\[user]\TEMP\__TEMP__98c972dbdd244112a2ae5c59c4969a5c.tmp.txt , so could make user confuse
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    vandang wrote:
    One more query, if I use the the request form after select the correct file, it's still show the temporary txt file and path, C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\users\[user]\TEMP\__TEMP__98c972dbdd244112a2ae5c59c4969a5c.tmp.txt , so could make user confuse
    When are you getting this message?

    when you are working with RTC, it will open a new window to select the file rather than asking you to enter in request page..

    try by running same report 9172
  • Options
    vandangvandang Member Posts: 101
    Hi mohana_cse06,

    It's not a message, it just a path I copy from request page after select the .txt file.

    You mean no need use request page in RTC, just open window then click Ok and run the code! It's good idea as well. Thanks!
  • Options
    yukonyukon Member Posts: 361
    Hi vandang,

    Your are right! User confuse the link. But can use below code for file select and combine with code. You can refer NAV 2013 CU-File Management.
    Var	Name	DataType	Subtype	Length
    No	WindowTitle	Text		1024
    No	DefaultFileName	Text		1024
    No	FilterString	Text		1024
    
    Name	DataType	Subtype	Length
    OpenFileDialog	DotNet	'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.OpenFileDialog	
    DialagResult	DotNet	'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.DialogResult	
    
    Return Text - 1024
    Function Name : OpenFileDialog (Add on 3-Tier Automation Mgt.)
    OpenFileDialog := OpenFileDialog.OpenFileDialog;
    OpenFileDialog.ShowReadOnly := FALSE;
    OpenFileDialog.FileName := GetFileName(DefaultFileName);
    OpenFileDialog.Title := WindowTitle;
    OpenFileDialog.Filter := GetToFilterText(FilterString,DefaultFileName);
    OpenFileDialog.InitialDirectory := GetDirectoryName(DefaultFileName);
    
    DialagResult := OpenFileDialog.ShowDialog;
    IF DialagResult.ToString() = 'OK' THEN
      EXIT(OpenFileDialog.FileName);
    EXIT('');
    
    How to use
    txtFile := cuFileMgt.OpenFileDialog(Text50006,'',Text50007);
    

    Noted : I use at NAV R2.
    Best Regards,
    Yukon
    Make Simple & Easy
  • Options
    vandangvandang Member Posts: 101
    Hi yukon,

    Please tell how can I apply your code
  • Options
    yukonyukon Member Posts: 361
    Hi vandang,

    Copy below code to notepad and save. After that import to your database. Before import you need to export your object (CU - 3-Tier Automation Mgt.). Below Code i merge NAV 2013 and R2 base on my requirement.
    OBJECT Codeunit 419 3-Tier Automation Mgt.
    {
      OBJECT-PROPERTIES
      {
        Date=01/29/13;
        Time=[ 5:17:55 PM];
        Modified=Yes;
        Version List=NAVW16.00.01;
      }
      PROPERTIES
      {
        OnRun=BEGIN
              END;
    
      }
      CODE
      {
        VAR
          Text001@1004 : TextConst 'ENU=Default';
          Text004@1000000018 : TextConst 'ENU=The file %1 does not exist.';
          Text006@1003 : TextConst 'ENU=Export';
          Text007@1002 : TextConst 'ENU=Import';
          Text009@1000 : TextConst 'ENU=All Files (*.*)|*.*';
          CommonDialogMgnt@1005 : Codeunit 412;
          ClientTempPath@1006 : Text[1024];
          Text010@1000000019 : TextConst 'ENU=The file %1 has not been uploaded.';
          Text011@1000000013 : TextConst 'ENU=You must specify a source file name.;ENA=You must specify a source file name.';
          Text012@1000000012 : TextConst 'ENU=You must specify a target file name.;ENA=You must specify a target file name.';
          XMLFileType@1000000008 : TextConst 'ENU=XML Files (*.xml)|*.xml;ENA=XML Files (*.xml)|*.xml';
          WordFileType@1000000007 : TextConst 'ENU=Word Files (*.doc)|*.doc;ENA=Word Files (*.doc)|*.doc';
          Word2007FileType@1000000006 : TextConst 'ENU=Word Files (*.doc*)|*.doc*;ENA=Word Files (*.doc*)|*.doc*';
          ExcelFileType@1000000005 : TextConst 'ENU=Excel Files (*.xls)|*.xls;ENA=Excel Files (*.xls)|*.xls';
          Excel2007FileType@1000000004 : TextConst 'ENU=Excel Files (*.xls*)|*.xls*;ENA=Excel Files (*.xls*)|*.xls*';
          XSDFileType@1000000003 : TextConst 'ENU=XSD Files (*.xsd)|*.xsd;ENA=XSD Files (*.xsd)|*.xsd';
          HTMFileType@1000000002 : TextConst 'ENU=HTM Files (*.htm)|*.htm;ENA=HTM Files (*.htm)|*.htm';
          XSLTFileType@1000000001 : TextConst 'ENU=XSLT Files (*.xslt)|*.xslt;ENA=XSLT Files (*.xslt)|*.xslt';
          TXTFileType@1000000000 : TextConst 'ENU=Text Files (*.txt)|*.txt;ENA=Text Files (*.txt)|*.txt';
          PathHelper@1000000010 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Path" RUNONCLIENT;
          ClientFileHelper@1000000009 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.File" RUNONCLIENT;
          ClientFileInfoHelper@1000000014 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.FileInfo" RUNONCLIENT;
          ServerFileHelper@1000000016 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.File";
          DirectoryHelper@1000000011 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Directory" RUNONCLIENT;
          XSLFileType@1000000015 : TextConst 'ENU=XSL Files (*.xsl)|*.xsl;ENA=XSLT Files (*.xslt)|*.xslt';
          Text50000@1000000017 : TextConst 'ENU=Files (*.%1)|*.%1';
    
        PROCEDURE BLOBImport@3(VAR BLOBRef@1000 : TEMPORARY Record 99008535;Name@1002 : Text[1024];CommonDialog@1003 : Boolean) : Text[1024];
        VAR
          NVInStream@1001 : InStream;
          NVOutStream@1004 : OutStream;
        BEGIN
          IF NOT ISSERVICETIER THEN BEGIN
            IF CommonDialog THEN BEGIN
              Name := CommonDialogMgnt.OpenFileWithName(Name);
              IF STRPOS(Name,'*') > 0 THEN
                EXIT('');
            END;
            BLOBRef.Blob.IMPORT(Name,FALSE);
            EXIT(Name);
          END
          ELSE BEGIN
            //IF UPLOADINTOSTREAM(Text007,'',Text009,Name,NVInStream) THEN BEGIN
            IF UPLOADINTOSTREAM(Text007,'',GetToFilterText('',Name),Name,NVInStream) THEN BEGIN
              BLOBRef.Blob.CREATEOUTSTREAM(NVOutStream);
              COPYSTREAM(NVOutStream,NVInStream);
              EXIT(Name);
            END;
            EXIT('');
          END
        END;
    
        PROCEDURE BLOBExport@4(VAR BLOBRef@1002 : TEMPORARY Record 99008535;Name@1001 : Text[1024];CommonDialog@1000 : Boolean) : Text[1024];
        VAR
          NVInStream@1003 : InStream;
          ToFile@1004 : Text[1024];
          p@1005 : Integer;
          Path@1006 : Text[1024];
        BEGIN
          IF NOT ISSERVICETIER THEN
            EXIT(BLOBRef.Blob.EXPORT(Name,CommonDialog))
          ELSE BEGIN
            BLOBRef.Blob.CREATEINSTREAM(NVInStream);
            IF STRPOS(Name,'*') = 0 THEN
              ToFile := Name
            ELSE BEGIN
              ToFile := INSSTR(Name,Text001,1);
              ToFile := DELCHR(ToFile,'=','*');
            END;
            WHILE STRPOS(ToFile,'\')<>0 DO BEGIN
              p := STRPOS(ToFile,'\');
              ToFile := COPYSTR(ToFile, p+1);
            END;
            Path := 'C:\TEMP';
            IF NOT CommonDialog THEN
              Path := Magicpath;
            //DOWNLOADFROMSTREAM(NVInStream,Text006,Path,Text009,ToFile);
            DOWNLOADFROMSTREAM(NVInStream,Text006,Path,GetToFilterText('',Name),ToFile);
            EXIT(ToFile);
          END
        END;
    
        PROCEDURE EnvironFileName@1(PassedString@1001 : Text[250];FileExtension@1002 : Text[250]) FileName : Text[1024];
        BEGIN
          IF NOT ISSERVICETIER THEN BEGIN
            IF STRPOS(PassedString,'%1') = 0 THEN
              FileName := ENVIRON('TEMP') + PassedString + FileExtension
            ELSE
              FileName := STRSUBSTNO(ENVIRON('TEMP') + PassedString,FileExtension)
          END ELSE
            EXIT(ServerTempFileName(PassedString,FileExtension));
        END;
    
        PROCEDURE ServerTempFileName@5(PassedString@1001 : Text[250];FileExtension@1002 : Text[250]) FileName : Text[1024];
        VAR
          TempFile@1000 : File;
        BEGIN
          TempFile.CREATETEMPFILE;
          FileName := TempFile.NAME + '.' + FileExtension;
          TempFile.CLOSE;
        END;
    
        PROCEDURE ClientTempFileName@6(PassedString@1001 : Text[250];FileExtension@1002 : Text[250]) ClientFileName : Text[1024];
        VAR
          TempFile@1004 : File;
        BEGIN
          IF ISSERVICETIER THEN BEGIN
            IF ClientTempPath = '' THEN BEGIN
              TempFile.CREATETEMPFILE;
              ClientFileName := TempFile.NAME + '.' + FileExtension;
              TempFile.CLOSE;
              TempFile.CREATE(ClientFileName);
              TempFile.CLOSE;
              ClientTempPath := Path(DownloadTempFile(ClientFileName));
            END;
            ClientFileName := ClientTempPath + '\' + FORMAT(CREATEGUID) + '.' + FileExtension;
          END ELSE
            ClientFileName := ServerTempFileName(PassedString, FileExtension);
        END;
    
        PROCEDURE DownloadTempFile@7(ServerFileName@1001 : Text[1024]) : Text[1024];
        VAR
          FileName@1102601003 : Text[1024];
          Path@1102601004 : Text[1024];
        BEGIN
          IF NOT ISSERVICETIER THEN
            EXIT(ServerFileName);
    
          FileName := ServerFileName;
          Path := Magicpath;
          DOWNLOAD(ServerFileName,'',Path,Text009,FileName);
          //DOWNLOAD(ServerFileName,'',Path,GetToFilterText('',FileName),FileName);
          EXIT(FileName);
        END;
    
        PROCEDURE Path@8(Filename@1102601000 : Text[1024]) Path : Text[1024];
        BEGIN
          Filename := DELCHR(Filename,'<');
          Path := Filename;
          WHILE STRPOS(Filename,'\')<>0 DO BEGIN
            Filename := COPYSTR(Filename, STRPOS(Filename,'\')+1);
          END;
          IF STRLEN(Path) > STRLEN(Filename) THEN
            EXIT(COPYSTR(Path,1,STRLEN(Path)-STRLEN(Filename)))
          ELSE
            EXIT('');
        END;
    
        PROCEDURE Magicpath@9() : Text[1024];
        BEGIN
          EXIT('<TEMP>');   // MAGIC PATH makes sure we don't get a prompt
        END;
    
        PROCEDURE UploadFileSilent@1000000012(ClientFilePath@1000000000 : Text[1024]) : Text[1024];
        VAR
          ServerFileName@1000000001 : Text[1024];
          TempClientFile@1000000002 : Text[1024];
          FileName@1000000003 : Text[1024];
          FileExtension@1000000004 : Text[1024];
        BEGIN
          IF NOT ClientFileHelper.Exists(ClientFilePath) THEN
            ERROR(Text004,ClientFilePath);
          FileName := GetFileName(ClientFilePath);
          FileExtension := GetExtension(FileName);
    
          TempClientFile := ClientTempFileName(FileName,FileExtension);
          ClientFileHelper.Copy(ClientFilePath,TempClientFile,TRUE);
    
          ServerFileName := ServerTempFileName(FileName,FileExtension);
    
          IF NOT UPLOAD('',Magicpath,Text009,GetFileName(TempClientFile),ServerFileName) THEN
            ERROR(Text010,ClientFilePath);
    
          ClientFileHelper.Delete(TempClientFile);
          EXIT(ServerFileName);
        END;
    
        PROCEDURE DeleteClientFile@1000000004(FilePath@1000000000 : Text[1024]) : Boolean;
        BEGIN
          IF NOT ClientFileHelper.Exists(FilePath) THEN
            EXIT(FALSE);
    
          ClientFileHelper.Delete(FilePath);
          EXIT(TRUE);
        END;
    
        PROCEDURE DeleteServerFile@1000000011(FilePath@1000000000 : Text[1024]) : Boolean;
        BEGIN
          IF NOT ServerFileHelper.Exists(FilePath) THEN
            EXIT(FALSE);
    
          ServerFileHelper.Delete(FilePath);
          EXIT(TRUE);
        END;
    
        PROCEDURE CopyClientFile@1000000005(SourceFileName@1000000000 : Text[1024];DestFileName@1000000001 : Text[1024];OverWrite@1000000002 : Boolean) : Boolean;
        BEGIN
          ClientFileHelper.Copy(SourceFileName,DestFileName,OverWrite);
        END;
    
        PROCEDURE ClientFileExists@1000000002(FilePath@1000000000 : Text[1024]) : Boolean;
        BEGIN
          EXIT(ClientFileHelper.Exists(FilePath));
        END;
    
        PROCEDURE ClientDirectoryExists@1000000006(DirectoryPath@1000000000 : Text[1024]) : Boolean;
        BEGIN
          EXIT(DirectoryHelper.Exists(DirectoryPath));
        END;
    
        PROCEDURE ServerFileExists@1000000013(FilePath@1000000000 : Text[1024]) : Boolean;
        BEGIN
          EXIT(ServerFileHelper.Exists(FilePath));
        END;
    
        PROCEDURE GetToFilterText@1000000000(FilterString@1000000000 : Text[1024];FileName@1000000001 : Text[1024]) : Text[1024];
        VAR
          OutExt@1000000002 : Text[1024];
        BEGIN
          IF FilterString <> '' THEN
            EXIT(FilterString);
    
          CASE UPPERCASE(GetExtension(FileName)) OF
            'DOC':
              OutExt := WordFileType;
            'DOCX':
              OutExt := Word2007FileType;
            'XLS':
              OutExt := ExcelFileType;
            'XLSX':
              OutExt := Excel2007FileType;
            'XSLT':
              OutExt := XSLTFileType;
            'XML':
              OutExt := XMLFileType;
            'XSD':
              OutExt := XSDFileType;
            'HTM':
              OutExt := HTMFileType;
            'TXT':
              OutExt := TXTFileType;
            'XSL':
              OutExt := XSLFileType;
            ELSE BEGIN
              OutExt := GetExtension(FileName);
              IF OutExt<>'' THEN
                OutExt := STRSUBSTNO(Text50000,OutExt);
            END;
          END;
          IF OutExt = '' THEN
            EXIT(Text009);
          EXIT(OutExt + '|' + Text009);  // Also give the option of the general selection
        END;
    
        PROCEDURE GetExtension@1000000001(Name@1000000000 : Text[1024]) : Text[5];
        VAR
          FileExtension@1000000001 : Text[1024];
        BEGIN
          FileExtension := PathHelper.GetExtension(Name);
          IF FileExtension <> '' THEN
            FileExtension := DELCHR(FileExtension,'<','.');
    
          EXIT(FileExtension);
        END;
    
        PROCEDURE GetFileName@1000000008(FilePath@1000000000 : Text[1024]) : Text[1024];
        BEGIN
          EXIT(PathHelper.GetFileName(FilePath));
        END;
    
        PROCEDURE GetFileSize@1000000010(FilePath@1000000000 : Text[1024]) : Decimal;
        BEGIN
          IF GetFileName(FilePath)='' THEN EXIT(0);
          ClientFileInfoHelper := ClientFileInfoHelper.FileInfo(FilePath);
          EXIT(ClientFileInfoHelper.Length);
        END;
    
        PROCEDURE GetDirectoryName@1000000009(FileName@1000000000 : Text[1024]) : Text[1024];
        BEGIN
          IF FileName = '' THEN
            EXIT(FileName);
    
          FileName := DELCHR(FileName,'<');
          EXIT(PathHelper.GetDirectoryName(FileName));
        END;
    
        PROCEDURE OpenFileDialog@1000000014(WindowTitle@1000000000 : Text[1024];DefaultFileName@1000000001 : Text[1024];FilterString@1000000002 : Text[1024]) : Text[1024];
        VAR
          OpenFileDialog@1000000003 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.OpenFileDialog" RUNONCLIENT;
          DialagResult@1000000004 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.DialogResult" RUNONCLIENT;
        BEGIN
          OpenFileDialog := OpenFileDialog.OpenFileDialog;
          OpenFileDialog.ShowReadOnly := FALSE;
          OpenFileDialog.FileName := GetFileName(DefaultFileName);
          OpenFileDialog.Title := WindowTitle;
          OpenFileDialog.Filter := GetToFilterText(FilterString,DefaultFileName);
          OpenFileDialog.InitialDirectory := GetDirectoryName(DefaultFileName);
    
          DialagResult := OpenFileDialog.ShowDialog;
          IF DialagResult.ToString() = 'OK' THEN
            EXIT(OpenFileDialog.FileName);
          EXIT('');
        END;
    
        PROCEDURE SaveFileDialog@1000000015(WindowTitle@1000000002 : Text[1024];DefaultFileName@1000000001 : Text[1024];FilterString@1000000000 : Text[1024]) : Text[1024];
        VAR
          SaveFileDialog@1000000003 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.SaveFileDialog" RUNONCLIENT;
          DialagResult@1000000004 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.DialogResult" RUNONCLIENT;
        BEGIN
          SaveFileDialog := SaveFileDialog.SaveFileDialog;
          SaveFileDialog.CheckPathExists := TRUE;
          SaveFileDialog.OverwritePrompt := TRUE;
          SaveFileDialog.FileName := GetFileName(DefaultFileName);
          SaveFileDialog.Title := WindowTitle;
          SaveFileDialog.Filter := GetToFilterText(FilterString,DefaultFileName);
          SaveFileDialog.InitialDirectory := GetDirectoryName(DefaultFileName);
    
          DialagResult := SaveFileDialog.ShowDialog;
          IF DialagResult.ToString() = 'OK' THEN
            EXIT(SaveFileDialog.FileName);
          EXIT('');
        END;
    
        PROCEDURE OpenFolderDialog@1000000016(WindowTitle@1000000002 : Text[1024]) : Text[1024];
        VAR
          FolderDialog@1000000003 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.FolderBrowserDialog" RUNONCLIENT;
          DialagResult@1000000004 : DotNet "'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Windows.Forms.DialogResult" RUNONCLIENT;
          txtFolder@1000000000 : Text[1024];
        BEGIN
          FolderDialog := FolderDialog.FolderBrowserDialog();
          FolderDialog.ShowNewFolderButton(TRUE);
          FolderDialog.ShowDialog;
          txtFolder := FolderDialog.SelectedPath;
          EXIT(txtFolder);
        END;
    
        PROCEDURE IsValidFileName@1000000003(FileName@1000000000 : Text[1024]) : Boolean;
        VAR
          String@1000000001 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String" RUNONCLIENT;
          String2@1000000002 : Code[10];
        BEGIN
          EXIT(TRUE);
          IF FileName = '' THEN
            EXIT(FALSE);
    
    
          IF String.IndexOfAny(PathHelper.GetInvalidFileNameChars) <> -1 THEN
            EXIT(FALSE);
    
          //String := GetDirectoryName(FileName);
          String.Copy(GetDirectoryName(FileName));
          IF String.IndexOfAny(PathHelper.GetInvalidPathChars) <> -1 THEN
            EXIT(FALSE);
    
          EXIT(TRUE);
        END;
    
        PROCEDURE ValidateFileNames@1000000007(ServerFileName@1000000000 : Text[1024];ClientFileName@1000000001 : Text[1024]);
        BEGIN
          IF NOT IsValidFileName(ServerFileName) THEN
            ERROR(Text011);
    
          IF NOT IsValidFileName(ClientFileName) THEN
            ERROR(Text012);
        END;
    
        BEGIN
        END.
      }
    }
    
    How to use
    txtFile := cuFileMgt.OpenFileDialog('File Select','','*.xml' <Depend on you>);

    Regards,
    Yukon
    Make Simple & Easy
  • Options
    vandangvandang Member Posts: 101
    Thanks you Yukon, it works :thumbsup:
  • Options
    yukonyukon Member Posts: 361
    Hi vandang,


    If you don't mind, please change your post status to "Solved".


    Regards,
    Yukon
    Make Simple & Easy
  • Options
    vandangvandang Member Posts: 101
    Thanks Yukon!
  • Options
    MammoMammo Member Posts: 107
    Guys,

    I got the same error and got the solution by following below steps;

    1. Stop the NAV Business Web Server service
    2. Stop the Microsoft Dynamics NAV server service
    3. Select the all tables containing 2000000071 till 2000000075 and compile them by pressing F11
    4. Start both the services which stopped in Step 1 & Step 2.

    Hope it will help.
Sign In or Register to comment.