In Dynamics 365 for Finance and Operations, the business requirement to display the total amount of a purchase order can be met using X++ code. By extending the PurchTable class, the getPurchTotalAmount method can be implemented to calculate and return the total dollar amount of a specific purchase order.
D365: How to set form control value in X++
This post demonstrates setting a form control value, controlling visibility of form controls, and getting the reference of a form control in X++. It addresses the business requirement of defaulting vendor account from Purchase Order to Add Products form in Dynamics 365 for Finance and Operations. The provided code accomplishes this task effectively and elegantly.
D365: How to get workflow assignee in X++
This content demonstrates how to retrieve the user assigned to the workflow for purchase orders in Dynamics 365 for Finance and Operations using X++ code. The given code extends the PurchTable table and includes a method to get the workflow assignee based on the pending status of the workflow work item.
D365: How to get last workflow approver in X++
This X++ code demonstrates how to retrieve the last workflow approver in Dynamics 365 for Finance and Operations using the getLastWorkflowApprover method. It joins tables to select the appropriate workflow tracking information and user details, returning the user ID of the last workflow approver.
D365FO: Get dimension display value in X++
This content demonstrates how to retrieve dimension display values in X++ for Dynamics 365 Finance and Operations. By utilizing the provided code, users can access dimension display values for custom forms or SSRS reports. The function 'getDimensionDisplayValue' accepts default dimension RecId and dimension name string, facilitating the retrieval of specific dimension values.
D365FO: Add query ranges to form data sources in X++
Purpose: In this post we're going to learn about how can we add ranges to form data sources using event handlers. Application: Dynamics 365 for Finance and Operations Business requirement: The requirement goes like business wants to restrict access to Purchase order confirmations such that user should only be able to see confirmations for their... 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 →
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 →