Purpose: The purpose of this post is to share how can we resolve Azure build pipeline errors. Application: Dynamics 365 Finance and Operations Problem: Recently I faced an issue while running build pipeline in Azure DevOps. The pipeline failed with errors like: The ExtendsOfAttribute specification is invalid. Please specify an existing element to extend. The... Continue Reading →
AX 2012: Handling CLR exceptions
Purpose: The purpose of this post is to demonstrate how can we effectively handle CLR exceptions. Application: Dynamics AX 2012 Business requirement: To report CLR inner exception. Solution: Please find the code below to get the inner CLR exception. Code private void getFiles() { System.String[] files; System.Collections.IEnumerator enumerator; str file; ; try { fileSet =... Continue Reading →
Add table to a default description
Extending default descriptions
Handy queries for addresses and contact information
Purpose: The purpose of this blog post is to share handy queries for addresses and contact information with the community Get site from contact information recordGet site from address recordGet warehouse from contact information recordGet warehouse from address recordGet customer from contact information recordGet customer from address recordGet vendor from contact information recordGet vendor from... Continue Reading →
Write TSV file in X++
Purpose: The purpose of this blog post is to demonstrate how can we write a tsv (tab delimited) file in X++ The code actually exports system database log to a TSV fileUses standard SysDatabaseLogReport queryAdds a range for Warehouse tableUses formatted datetime string for filename Product: Dynamics AX 2012 Code: Class declaration. class MAKSysDatabaseLogService {... Continue Reading →
Get path for menu item in X++
Purpose: This post describes how we can get the full menu path of a given menu item. Product: Dynamics AX 2012 Code: static void MAKMenuItemPath(Args _args) { #TreeNodeSysNodeType #Properties #AOT TreeNode menuItemNode = TreeNode::findNode(@"\Menu Items\Display\HRMParameters"); TreeNode menuNode; xRefPaths xRefPaths; xRefReferences xRefReferences; TreeNode parentNode; str path; xRefPaths = xRefPaths::find(menuItemNode.treeNodePath()); while select xRefReferences where xRefReferences.referencePathRecId == xRefPaths.RecId... Continue Reading →
Validate email addresses using regular expression
Purpose: The purpose of this post is to demonstrate how can we validate the data entry of email addresses. Product: Dynamics 365 for Finance and Operations Description: The code below uses regular expressions to validate the data entry of email addresses by hooking up a ValidatedField event handler to LogisticsElectronicAddress table. Code: /// <summary> ///... Continue Reading →
Extensions examples
Purpose: The purpose of this post is to share examples of extensions. Product: Dynamics 365 for Finance and Operations Code: Form data source event handler. Event type: ValidatedWrite /// <summary> /// OnValidatedWrite handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> [FormDataSourceEventHandler(formDataSourceStr(DirPartyQuickCreateForm, DirPartyTable), FormDataSourceEventType::ValidatedWrite)] public static void DirPartyTable_OnValidatedWrite(FormDataSource sender, FormDataSourceEventArgs e) { #define.CallerFormName("CustTable") FormRun formRun... Continue Reading →
Chain of command example
Purpose: The purpose of this post is to demonstrate how we can we extend a standard code by using the chain-of-command framework. Product: Dynamics 365 for Finance and Operations Description: The code below extends the saveAttributeValueSet method of DimensionEntryControl class using the chain-of-command framework. Code: [ExtensionOf(classStr(DimensionEntryControl))] final class DimensionEntryControlSXS_Extension { public DimensionDefault saveAttributeValueSet() { #define.CallerFormName("CustTable")... Continue Reading →
Validate individual financial dimensions
Purpose: The purpose of this post is to demonstrate how we can validate individual financial dimension values before writing a customer record. Product: Dynamics 365 for Finance and Operations Description: The code below validates some customer fields like Site, Warehouse, Price group and then checks the values for individual financial dimensions in this case which... Continue Reading →