How to pass parameters on forms (Urgent!)

mike_espina
Member Posts: 55
Experts,
How do I pass parameters to form. I have made a job that calls a certain form. What I want is that, there is a parameter that I want to pass in the job and get that parameter in the form when the form is called. Take note that I dont have a license in making a class.
thank you very much.
Mike
How do I pass parameters to form. I have made a job that calls a certain form. What I want is that, there is a parameter that I want to pass in the job and get that parameter in the form when the form is called. Take note that I dont have a license in making a class.
thank you very much.
Mike
0
Comments
-
You need to search in the Axapta dev guide for the Args class\Using forms. The args helps passing parms between objects. See also Args definition in the AOT\Sys documentation.Kind regards,
Ciprian Dudau
Axapta Developer0 -
Here is an example of code:
Args myArgs = new Args(); FormRun formRun; DirectPurchLines myDirectPurchLines; DirectPurchId myDirectPurchId; DirectPurchTable myDirectPurchTable; ; // create an object of class Args and passes the DirectPurchLineForm into it - this // is the object that is being called myArgs = new Args(formstr(DirectPurchLinesForm)); // this identifies the calling object myArgs.caller(this); //This function passes a string parameter into the called object myArgs.parm(StrFMT("%1\nedit", myDirectPurchId)); //Creates a FormRun object based on what we inserted into args formRun = ClassFactory::formRunClassOnClient(myArgs); //calls the init() method of the created form formRun.init(); formRun.run(); formRun.wait();
Then, in the init method of your called form you add the following code to see the result://this returns the args object that was passed on to the form myArgs = element.args(); // this line reads the passed string parameters (delimiter is \n) myDirectPurchId = strline(myArgs.parm(),0); myPrm = strline(myArgs.parm(),1);
Good luck.
And do read about it in the Dev Guide that was advised to you.Vanya Kashperuk,
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888
Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/37145820
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions