Wednesday, November 22, 2017

Simple Dialog box to browse the file using X++

static void Simple_Dialog(Args _args)
{   
      dialog              dialog;   
      dialogGroup    dialogGroup;   
      dialogField      dialogField;
      Filename         filename;     

     dialog            = new Dialog("Simple Dialog");  //Header 
     dialogGroup  = dialog.addGroup("Customer");  // Group Name 
     dialogField    = dialog.addField(extendedTypeStr(FilenameOpen));    //FilenameOpen is an EDT
   
     if (dialog.run())   
    {
     
      filename = dialogField.value();
   
           if(filename)
            {
               print dialogField.value();
               pause; 
             }
            else
             {
               info("file does not exists")
     }
}


///The dialog.run() method returns true if OK is clicked, and false if Cancel is clicked. 

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// ...