Thursday 2 March 2017

Argument Passing from ListPage to another form

  1. First Create Two tables  header and line  
  2. Create Two forms as header (ListPage) and line (Normal form) (listpage datasource  query must be created with two tables)
  3. In the header form and line form  add the respective datasource  i.e header and line table (in both the form)
  4. Create a menu item button in design node of Header Form  actionpane  and add a new method  in it(under the button ) 
  5. Link the menu item button with line table menuitem  (properties of menuitem button)
  1. Drag and drop the fields in the design node both the forms (grid  format) 
  2. Paste the code  below  in init method of line form 
public void init()
    {
          TestImport table1;
           super();
           table1 = element.args().record();
             TestImport_ds.query().dataSourceTable(Tablenum(TestImport)).addRange(fieldNum(table1,RecId)).
          value(SysQuery::value(table1.RecId));
        }
        • Open the header form and  click  the button you have created  after selecting the record in grid



        Important Note: screenshots based on my listpage   you can do it in  normal form also
         small difference is menu item button  in list page form  will be created
        in normal form  button is used





        final note: check the design field and button properties that are linked to the table

        No comments:

        Post a Comment