Yet another blog for Dynamics 365 for Finance and Operations. This blog primarily targets technical readers. I will be sharing my experience with Dynamics AX using code snippets, errors, and solutions, Tips, and tricks. Any feedback regarding a post or overall site are always welcome.
In the case where you need to print a barcode on a report, try the below code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Often we need to create Journals via X++ code as part of customization or integration and dimension is always the tricky part of this. How to validate the dimension combination value as per rules set in the system.
I am sharing a code sample to do the same, check this code and you may need to replace some dimension names or add/remove dimensions as per your requirement. The below code sample will validate
1. Main account
2. Individual dimension value
3. Deactivated dimension values
4. Dimension combination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(conPeek(dimCon, 2) != "") // Use this code to pick dimension as per appear in combination, eg. Division is the dimension which appears at position 2 in dimension value
{
valueContract = new DimensionAttributeValueContract();
valueContract.parmName("Division"); //Dimension name
valueContract.parmValue(conPeek(dimCon, 2)); //Position within dimension value
listValueContract.addEnd(valueContract);
}
// Cost centre
if(conPeek(dimCon, 3) != "")
{
valueContract = new DimensionAttributeValueContract();
valueContract.parmName("CostCentre");
valueContract.parmValue(conPeek(dimCon, 3));
listValueContract.addEnd(valueContract);
}
// Business unit
if(conPeek(dimCon, 4) != "")
{
valueContract = new DimensionAttributeValueContract();