How to use codeunit 412

LeoNavLeoNav Member Posts: 55
Hello, :wink:

I need to have a control helping me to select a file on a form. So, I decided to use the codeunit 412 Common Dialog Management.
But I can't make it work correctly.
For the moment, I have a simple textbox. Here is the code I use :

CodeUnit412 variable has the type Codeunit. Is it correct ?
I don't know what type the content variable must have.
Content:= CodeUnit412.OpenFile(WindowTitle,DefaultFileName,DefaultFileType,FilterString,Action)

I know there are 5 parameters to set up with this CU but I don't know what those parametters must look like. What is the window title ? etc.
Can you give me documentation on this CU or a concrete example on how to use it please ?

Thanks. :)

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Have a look at the request form of report 81. The OnAssistEdit-trigger of the variable FileName contains this line of code:
    FileName := CommonDialogMgt.OpenFile(Text006,'',2,'',0);
    
    with the variables
    FileName: Text
    CommonDialgoMgt: Codeunit "Common Dialog Management"
    Text006: Text Constant containing "Import Excel File"
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • LeoNavLeoNav Member Posts: 55
    Ok perfect. It works fine now !!
    Thanks. :)
Sign In or Register to comment.