AX – D365FO – How to count affected/updated rows in a Update_recordset statement

How to know how many rows have been updated in a Update_recordset statement? It's simple, you can just use rowCount() method of the table after the update statement like shown below update_recordset inventTable setting ERACommercialGroupId = comunanzaERA.SubGroupId join comunanzaERA where inventTable.ItemId == comunanzaERA.comunanzaCode && comunanzaERA.SubGroupId != ''; info(strFmt("Copy Items from Comunanza ERA Subgroup Id to … Continua a leggere AX – D365FO – How to count affected/updated rows in a Update_recordset statement

AX – D365FO – Update a field value of a table with the value of a joined table in update_recordset

This example shows that the update_recordset statement supports the joining of several tables. Data from the joined tables can be used to assign values to fields in the table that is being updated. static void Join22aJob(Args _args) { TableEmployee tabEmpl; TableDepartment tabDept; TableProject tabProj; ; update_recordset tabEmpl setting currentStatusDescription = tabDept.DeptName + ", " + … Continua a leggere AX – D365FO – Update a field value of a table with the value of a joined table in update_recordset

AX – D365FO – X++ code to find all the Duties related to specific Privileges in AX 2012

static void findAllTheDutiesForSpecificPrivileges(Args _args) { SecurityTask securityTask; SecuritySubTask securitySubTask; #define.SecurityTask("AbbreviationCodeImport_Import_RU") // your privileges name select firstOnly RecId from securityTask where securityTask.AotName == #SecurityTask && securityTask.Type == SecurityTaskType::Privilege; while select SecurityTask from securitySubTask where securitySubTask.SecuritySubTask == securityTask.RecId { select firstOnly * from securityTask where securityTask.RecId == securitySubTask.SecurityTask; info(strFmt(“%1,%2,%3″, securityTask.AOTNAME, securityTask.Name, securityTask.Type)); } }

AX – D365FO – Cannot see newly created data source on a ListPage Form

When you come back to list page and try to restore the form you will not be able to see the new data source. To do this right click on the data source node and again define the name of the query. This will reload the new structure from the query. 4. Then you can view … Continua a leggere AX – D365FO – Cannot see newly created data source on a ListPage Form

AX – D365FO – Unable to to Add/Update the Data Source on a ListPage in Microsoft Dynamics AX 2012

You CANNOT drag and drop a data source into a list page.  This is different than most forms, so it always stumps me! Instead, right click on the ‘Data Sources’ node within the form.  The query property sets the data source. If you’ve modified the query and would like to refresh it, you must change the … Continua a leggere AX – D365FO – Unable to to Add/Update the Data Source on a ListPage in Microsoft Dynamics AX 2012

AX – D365FO – Add an hyperlink to a Form field to open the master data FOrm of that field

I have a form that contains a field called "IFRS code". I want to add an hyperlink to this field to open a form that contains the master table for that field when clicking on it (like below) If you do nothing you get this error while clicking on the field To solve the problem … Continua a leggere AX – D365FO – Add an hyperlink to a Form field to open the master data FOrm of that field

AX – D365FO – Change Action pane and buttons Style on a AX 2012 Form

I created a Form wirth an action pane and a grid . The action pane contains 2 command buttons (one for records creations and the other for records deletion). The buttons style is very very ugly, beacause they have only text and are not horizzontally aligned (see image below) I want to obtain a better … Continua a leggere AX – D365FO – Change Action pane and buttons Style on a AX 2012 Form

AX – D365FO – SSRS report parameters duplicating (appearing twice) in AX2012

Open your report in Visual Studio and under Parameters node, check if your parameter is repeating. If yes, delete one. Most of the time it happens during development when you are changing code again n again. It cahces your previous code and shows new and previous both. In this case : Clear all of your … Continua a leggere AX – D365FO – SSRS report parameters duplicating (appearing twice) in AX2012