lundi 11 octobre 2010

How To create Dialogs using X++

We can instead of using froms create dialogs if we need to precise dates , years0, select employee(s), ..., fill your temporary table(s)  and then display your report. In such scenario you can make use of RunBase class. 

RunBase class  provides dialog for presenting and collecting the information from user and validates method , to validate the data entered by the user in the dialog.
I 've designed a  report.  I build a class"TmpPopulateClass" , and a method "populate" for example , I fill my table with the appropriate data and "populate" returns TmpTable. I call this method in my fetch report method. I set this temporary table as a datasource for my report.
I  got the fields year1, emplid from my dialog wich I created via "Dialog" and "GetDialog" methods in my report.









If  I use a textBuffer, I have ti initialize it in the init method.








Fields of the temporary table , can be used then in my report design.
Then I  put this report in the output menuitems. and I can display my dialog, call methods , fill tables via my dialog.












It is possible also to call another report using the same dialog although the feth method is created in only one report ,  we can also create two report designs in the same report and call one of them.


















As we see the two reports are diffrent and have diffrent datasource, thus I created a queryrun associated to each report . I fill in the datasource : temporary tables and according to informations in my dialogs I can display
my report.
 Resources

Aucun commentaire:

Enregistrer un commentaire