Posts

Showing posts from July, 2013

Create a custom lookup with multiple data sources on form using X++

Open the form on which you want to create a custom lookup. Go the data source - fields, select field and override the lookup method. Following code will help you in creating custom lookup using SysTableLookup with multiple data sources.  public void lookup(FormControl _formControl, str _filterStr) {      SysTableLookup            sysTableLookup;      Query                          query;      QueryBuildDataSource  qbds1, qbds2;      ;      sysTableLookup = SysTableLookup::newParameters(tablenum(table1),_formcontrol);      query = new Query();      qbds1 = query.addDataSource(tablenum(table1));    ...

Creating a Dialog using X++

Static Void DialogExample(Args _args) {         Dialog                  dialog ;         DialogGroup         dialogGrp;         DialogField           dlgCustAccount;       DialogField           dlgCustName;       CustAccount         custAcct;       CustName            custName;       ;       dialog.Caption("Customer information");       dialogGrp = dialog.AddGroup("Setup");     ...

Reading CSV file using X++

Static void ReadCSVFile(Args _args)   {      #File      IO                                     iO;      FilenameOpen                fileName = "C:\\abcd.csv";      Container                        con;      boolean                           firstRecordHdr = true;      Str                             ...