X++ tips and tricks: Passing parameters in Microsoft Dynamics AX Args is your companion in the world of X++ tips and tricks. Args is an abbreviation for arguments. It allows you to pass information from one object to another newly created object. I utilize it frequently to pass the objects, records, strings, etc that I need to have in scope while accessing the object from another object. It’s very easy to utilize the Args class to get the desired result you’re looking for. The following example demonstrates how to create an instance of the Args class: Declaration of Args Args args = new Args(); CustTable custTable; Setting record is Args select custTable where custTable.AccountNum == ‘XXXX’ if(custTable) { args.record(custTable); } Some important methods of Args class Caller Get or sets the instance of the object that created this instance of the Args class. Name Gets and sets the name of the application object to call. Parm Gets or sets a s...
Posts
Showing posts from 2016
- Get link
- X
- Other Apps
Dialog in class with batch job in AX/ working with batch job in AX 1. Class have to extend the RunbaseBatch 2. implement the Run() in this method we can call our method which is created for logic(upload()). 3. Implement the pack and unpack methods 4. Implement the dialog() method 5. Construct() method 6. getFromDialog() method 7. Main method 8. Description method 9. Validate method 10.canGoBatch() 11.canGoBatchJournal -- class INU_UpdExtProcComplete extends runbasebatch { DialogField dlgField; FilenameOpen filenameOpen; #define.CurrentVersion(1) #define.Version(1) #localmacro.CurrentList filenameOpen #endmacro } -- public void run() { if(filenameOpen) { if(WINAPI::fileExists(filenameOpen)) this.upload(); else throw error("@SYS26757"); } super(); } -- client static INU_UpdExtProcComplete construct() { return new INU_UpdExtProcComplete(); } -- public container pack() { return [#CurrentVersion,#CurrentList]; } -- public boolean unpack(container packedClass) { Version version = ...