Dear Dude, Lets explain two ways of opening another form. First of all, this is not all wisdom, maybe sometimes my explanation is not always completely true. Might this be the case, I hope someone will correct me.
First Situation: Open another form using the MenuItem properties: =============================================== Create a MenuItem of type Display (node display). Create two forms. On the first form create a button and Assign the name of the MenuItem to the properties MenuItemName and MenuItemType. The properties Class and Object on the MenuItem should point to the form you wish to open. Thus Class is set to form and Object is set to the form name. Create the second form: In the init() method of the form you can capture a few things from the calling form (first form): dataset() record() parmenum() parmenumtype() parm() parmObject() You can for example put print statements in the init() method to see what each of the above represent. ++ ParmEnum() and ParmEnumType() The parmenum() and parmenumtype() are related to the properties EnumTypeParameter and EnumParameter on the MenuItem. The EnumTypeParameter identifies the BaseEnum you are passing to the Form. The EnumParameter identifies which of the BaseEnum values you are using. Example of its use can be found on the SalesTable form. Under the button Posting.you will find other buttons that represent a type of document. Each of these buttons when active have the MenuItem properties set to their respective menu item. The menu item itselve has the EnumTypeParameter set to DocumentStatus and the EnumParameter to - lets say for simplicity - the type of document. Each of the menu items will call the Class SalesFormLetter. This class will capture the type of document as follow: args.parmEnum(). ++ DataSet() and Record() The DataSet()and Record() can be used to find out wich record was active in the form from which the element was opened, as well as which table the relevant record stems from. ++ Parm() is related to the property Parameters on the MenuItem Can be used to pass text to the form being opened. ++ ParmObject() is related to the property Object on the MenuItem. Used to pass the Object that you want to open Now all of these can be used when not opening a form through a menu item but through a clicked() method on a button. Second Situation: Open another Form in the clicked() method of a button ===================================================== You can pass arguments as: a name-string an object of type form Create an Example: You need two forms. The first form opens the SalesTable and the second form opens the CustTable. The second form is opened through a click on a button, located on the first form. Now first thing you do is create the second form . ++ second form: create the form, add the datasource CustTable, create a grid to display some fields (at least the customer id and name). Override the clicked() method on the form and put some print statement in it that display what is being passed as arguments. example: print element.args().parm() print element.args().name(); print element.args().dataset(); print element.args().caller(); pause; window 0, 0; //close the print-window You will see what is possible once you have entered the dot a popup to select from will appear. That is all you need to do for the second form. ++ first form: create the form, add the datasource SalesTable, create a grid to display some fields (at least the order number and customer), create a button on the design. Override the clicked() method on the button. void clicked() { Args args = new Args(); FormRun TRA_Customer; ; args.name(formStr(SecondFormName)); // passing arguments by name args.caller(this); args.record(SalesTable); // ensures the correct customer is shown TRA_Customer = classFactory.formRunClass(args); TRA_Customer.init(); // not really necessary, init() method will always be executed TRA_Customer.run(); } The caller() method is used to transfer information about the object (first form) that created the object (second form). args.caller(this)is referring to the object from which the form is opened. If you leave it out of the clicked() method, your print element.args().caller() will result into zero. Regards, Danny --- In [EMAIL PROTECTED], "axapta_dude" <[EMAIL PROTECTED]> wrote: > hi, i'm a newbie and need some help from expert....... > I'm confuse on the syntax to pass information using args class. > I'm trying to pass some information from a form using clicked method to another form. > what must i write inside the clicked method and how i want to receive the information in > another form. > > I read in X++ guide on how to transfer data and i cannot find which line that transfer the > data.Can anybody explain to me? > > Args args = new Args(); > Form form = new Form(formstr(Formname)); > Formrun formrun; > ; > args.object(form); > args.caller(this); // what is "this" referring to > args.name(formstr(Formname)); > formRun = ClassFactory.formrunclass(args); > formrun.init(); > formrun.run(); > formrun.wait(); > > thanx in advanced ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. Now with Pop-Up Blocker. Get it for free! http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/kGEolB/TM --------------------------------------------------------------------~-> Sharing the knowledge on Axapta. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Axapta-Knowledge-Village/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/