Options

Open file dialog throws insufficient memory error in NAV2013

tsvtsv Member Posts: 49
edited 2013-05-11 in NAV Three Tier
Hi All,

Its in NAV 2013. I want to open a file open dialog and choose the any file and return the path back to the system and store in a control.something like how Links will work.
but after writing the below code am getting an error like

"The Common dialog function failed during initiazation.
this error often occurs when insufficient memory is available"

FileDialog -> OCX ->Microsoft Common Dialog Control, version 6.0
IF Title <> '' THEN
  FileDialog.DialogTitle := Title;
IF StartDir <> '' THEN
  FileDialog.InitDir := StartDir;
IF Filter <> '' THEN
  FileDialog.Filter := Filter;

FileDialog.ShowOpen;
Return := FileDialog.FileName;

kindly help to solve this please :(
with regards,
tsv

Answers

  • Options
    ara3nara3n Member Posts: 9,256
    I'm guessing your FileDialog is a custom CU?
    You need to use the CU 419 File Management.

    There is a function called OpenFileDialog (WindowTitle : Text[50];DefaultFileName : Text;FilterString : Text) : Text

    It uses dotnet datatypes instead of OCX.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Options
    tsvtsv Member Posts: 49
    Great !! =D>
    thats works perfectly fine.. thanks a ton..
    with regards,
    tsv
  • Options
    ara3nara3n Member Posts: 9,256
    You are welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.