Skip to main content

Posts

Showing posts from May, 2013

AX 2009: Save the report in different format

In AX 2009, whenever a user runs a report, by default first it prints to screen. But sometimes, you want a report to go straight to the printer or save it in some format, without a user intervention.  So in such case you need to develop the logic. But again if you want to have a report printed on screen, need to change the logic. So to avoid that you can write your logic in such a way that whenever you open a report, it prompts you whether report should be saved in Excel or not.
If you click on say “Yes” then it asks you for the save path and if you click on “No” then it prints on screen. Inorder to design this functionality we can add the logic in fetch method of the report. Say,

public boolean fetch() {     boolean ret;     dialog      d  = new dialog("Select file");     dialogField df;     ;     if (box::yesNo("Do you want to save it in Excel?", dialogbutton::Yes, "Save in Excel") == dialogbutton::Yes)     {         df = d.addField(typeid(FileNameSave), "Sele…

Open any object from code editor to in AOT node (Editor Script)

Using below code developer will have ease of opening any object from AX code editor to AOT node.


Below image shows how to move in to AOT just by right clicking an object.


And once you click on “OpenInAOT” that particular object pop up. As shown below.



TO GET THIS ADDINS “OPENINAOT” JUST COPY THE CODE AND PASTE IT IN EDITOR SCRIPT CLASS AS A METHOD.


void addIns_OpenInAOT(Editor e) {     #AOT     TreeNode        treeNode;     FreeText        selectedLine;     str 1           curSymbol;     int             iCopyFrom;     int             iCopyTo;     Set             selectedNodesSet = new Set(Types::Class);     SetIterator     setIterator;     Map             map;
    void add2Set(TreeNodePath _path)     {         ;         treeNode = TreeNode::findNode(_path + #AOTRootPath + selectedLine);         if (treeNode)

SysInfoAction class / Go to main table from Infolog message in AX 2009 / AX 2012:

The SysInfoAction class provides the ability to add an action to the standard infolog.
The user can then perform the action by clicking the infolog. The SysInfoAction class can be extended to perform custom actions e.g. opening a file using the default application.

Examples:

The example below uses the SysInfoAction_Formrun class and will open the "Accounts receivable parameters" form if the user clicks the infolog. 
static void AV_TestSysInfoAction_FormRun(Args   _args) {     SysInfoAction_FormRun    infoAction = SysInfoAction_FormRun::newFormName(formStr(CustParameters));     ;
    infoAction.parmDescription("Open parameters");     info("The parameters have not been entered.", "", infoAction); }
The Infolog System can be easily customized in Dynamics AX. You can attach actions to the displayed messages in the infolog. Upon double clicking the message you can go to another form, related to the displayed message.

Solution: use SysInfoAction_TableField cl…