Skip to main content

Posts

Showing posts from July, 2013

Form Method calling Sequence in Dynamics AX

 Courtesy: http://msdaxerp.wordpress.com/category/forms/ This gives the information of method calls in the form level while           1. Opening the Form.           2. Creating/Updating/Deleting the record in the Form.           3. Closing the Form. Sequence of Methods calls while opening the Form Form — init () Form — Datasource — init () Form — run ()   Form — Datasource — execute Query () Form — Datasource — active () Sequence of Methods calls while closing the Form Form — canClose () Form — close () Sequence of Methods calls while creating the record in the Form Form — Datasource — create () Form — Datasource — initValue () Table — initValue () Form — Datasource — active () Sequence of Method calls while saving the record in the Form Form — Datasource — ValidateWrite () ...

How to design and call a form through X++ code

http://msdn.microsoft.com/en-us/library/formrun.control.aspx static void createForm(Args _args) { Args args; Form form; FormRun formRun; FormBuildDesign formBuildDesign; FormBuildDataSource formBuildDataSource; FormBuildGridControl formBuildGridControl; FormGridControl formGridControl; DictTable dictTable; int idx; int height; // Create the form header. form = new Form(); form.name("myForm"); // Add data sources to the form. dictTable = new DictTable(tableNum(custTable)); formBuildDataSource = form.addDataSource(dictTable.name()); formBuildDataSource.table(dictTable.id()); // Create the form design. formBuildDesign = form.addDesign('Design'); // Add a grid control. formBuildGridControl = formBuildDesign.addControl(FormControlType::Grid,'Grid'); idx = formBuildGridControl.id(); formBuildGridControl.addDataField(formBuildDataSource....

How to pass value from form to class, AX 2012

Courtesy : DUG Dynamics User Group It's very simple to pass value from a form to a class by defining a method on form and using args.caller() in the class. 1. Take a String control in the form design like  string Customer Name. 2. Go to String control properties and set "Auto declaration" property to "Yes". 3. Go to form methods -> new method -> write return type method like;           public str customerName()      {            return CustomerName.Text();      } 4. Go to main() method of the class and type following:     public static void main(Args args)     {            str custName;            ;                if(formHasMethod(a...

calling method on a caller form

Courtesy: http://dynamicsuser.net/forums/p/43513/220210.aspx Problem: Hi, I created a form F with method M and class C , i want to call method M in  class C . Ths. Solution: In class C: Object                  formRunObject; ; if (args.caller() && formHasMethod(args.caller(), identifierstr(M)))  {         formRunObject = args.caller();         formRunObject.M();     }