Showing posts with label Get file path in Form level in ax 2012. Show all posts
Showing posts with label Get file path in Form level in ax 2012. Show all posts

Thursday, 13 September 2018

Get file path in Form level in ax 2012

   LedgerJournalTransEFT              ledJournalTransEFT; --->table
   ExportEFTDetails                        exportEFT;    ------------->Class
   FormDataSource                          LedgerJournalTransEFT_ds;--->datasource declaration
   str                                                 fileName,folderPath;


    if (args.record().TableId == tableNum(LedgerJournalTransEFT))
    {
        ledJournalTransEFT           = args.record();
        LedgerJournalTransEFT_ds  = ledJournalTransEFT.dataSource();
        exportEFT = new ExportEFTDetails(LedgerJournalTransEFT_ds);
    }




if (LedgerJournalTransEFT_ds.anyMarked()) ----->selected lines
    {
        formRun = LedgerJournalTransEFT_ds.formRun();
        if(formRun)
        {
            frmCtrl = formRun.design().controlName(formControlStr(LedgerJournalTransEFT,StringEdit));
            if(frmCtrl)
            {
                folderPath = frmCtrl.valueStr();--------->get selected folder path
                if(!folderPath)
                {
                    throw error("Kindly select the export folder path");
                }
            }
        }
   }