Dynamics AX Blog - Axapta 2.5 - Posts from 2014
These posts are machine-translated.
Currently, only posts are displayed, which are relevant for Dynamics AX version »Axapta 2.5« 
RSS-Feed of this version

RSS-Feed of this version
Currently, only posts from »2014« are displayed
Use macro within a SELECT statementThe SELECT-Statement in the example lists only active BOM items (Table BOM) on (active using the fields FromDate and ToDate). If the second parameter of the macro is empty (zero date ()), so all BOM items are listed. static void useMacroInSelectStatement(Args _args) { bom bom; date emptyDate; // parameters: %1 = table instance, %2 date, %3 empty date value #localmacro.bomDateFilter && ( %2 == dateNull() || ( ((%1.FromDate <= %2) && (%1.ToDate >= %2)) || ((%1.FromDate == %3) && (%1.ToDate == %3)) || ((%1.FromDate <= %2) && (%1.ToDate == %3)) || ((%1.FromDate == %3) && (%1.ToDate >= %2)) )) #endMacro ; while select bom where bom.ItemId == '123' #bomDateFilter(bom, systemDateGet(), emptyDate) { info(bom.bomid); } } |
Which fields are shown in an auto-generated lookup?I was asked this question recently and was not able to answer. But i still knew that i had seen a page where this is explained in detail. But i knew neither find it manually nor using various search engines. But in old documents of mine i found the source then, the trick to find it using search engines, is using the old name of Microsoft Dynamics AX - Axapta to look for it! Do this, you will quickly find following page: |
|
|
|
|
|
|
Find below a short example, how to add object nodes to a shared project through code.
{
projectNode projectNode;
TreeNode treeNode;
#AOT
#AOTExport
projectNode = infolog.projectRootNode();
projectNode = projectNode.AOTfindChild(#expProjectShared);
projectNode = projectNode.AOTfindChild('MyProject');
// Add objects
treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(CustGroup)));
projectNode.addNode(treenode);
treenode = TreeNode::findNode(#TablesPath+'\\'+tableid2name(tablenum(VendGroup)));
projectNode.addNode(treenode);
treenode = TreeNode::findNode(#ClassesPath+'\\'+classStr(PriceDisc));
projectNode.addNode(treenode);
}
The so modified Project will look like this: