Dynamics AX Blog - Posts from Juni 2016
These posts are machine-translated.
Detect/Respond on changing the edit modeTo respond in a form to change the edit mode, you can see the task () - Override method of the form as follows:
public int task(int _taskId)
{
int ret;
#Task
ret = super(_taskId);
switch(_taskId)
{
case #taskEditRecord:
…doSomething…
break;
}
return ret;
}
To get the current edit mode you may use the following method: element.inViewMode() |
Use special characters in the XML-header of a methodSometimes you have to use special characters in the XML header of a method to document the code well. To get sure, that this header is still well-formed and is not identified as best practice deviation, you can use a CDATA section.
/// <version>
/// 1.0
/// </version>
/// <summary>
/// <![CDATA[ Replaces following special characters: &, % ]]>
/// </summary>
private void someMethod()
{
//...do something...
}
Without this CDATA section AX would spend the following BP-Deviation:
|
Get design names of a SSRS reportAnyone who has the need to get the available designs of a SSRS report, can use the following job.
static void listDesignsOfSSRSReport(Args _args)
{
TreeNode treeNode;
TreeNode treeNodeDesign;
#aot
treeNode = TreeNode::findNode(#SSRSReportsPath + #AOTRootPath);
treeNode = treeNode.AOTfindChild("SalesPackingSlip");
treeNodeDesign = treeNode.AOTfindChild("Designs");
treeNodeDesign =
treeNodeDesign.AOTfirstChild();
while(treeNodeDesign)
{
info(treeNodeDesign.AOTname());
treeNodeDesign = treeNodeDesign.AOTnextSibling();
}
} |
|
|
|
|
|
|

Recently, I had to find out if a label exists in a certain language (in the example de_at), or not. Well suited for it seems the following SQL statement.