Inheritance form in AX 2012Continue reading
Creation of form based on inheritance tables without “Specifying type of new record” dialog box.
First of all we will need set of tables with inheritance applied. To do so follow the white paper provided my Microsoft:
When creating inheritance tables Microsoft Dynamics AX 2012 will add automatically relations to them but you might come across an error like this: “Duplicate relation name Organization detected in table inheritance.” This simply occurs as in both NoneProfitOrganization and GovernmentOrganization table Dynamics AX created relations with the same name in this case “Organization”. To resolve this issue simply rename one of the relations.
When all the tables with inheritance are set up we can move onto creating form.
In the white paper there is chapter about forms but it creates form where we need to use the dialog to select what type of record will be creating.
In this scenario we want Dynamics AX automatically detect where to create record depending what will be visible at the moment.
So let’s create from template SimpleList form and call it “Party”. Add the base “Party” table to data sources and save it.
You can see all the inheritance tables in the derived data sources:
Now we will want to be able to see fields from base table and fields tables rom each derived table.
So let’s add to the grid some of the fields from base table “Party” and from one of the derived e.g. “Person”. Now whenever we will want to add new record it will asks as what type should create:
Let’s create two record one type “Person” and other one type ”Government Organization” and see what has happened on the form some of the fields have been crossed out:
So every time we create different record we will only be able to access those fields that are assigned to it. So what if we want to only see fields assigned to specific type? Let’s change the form a little bit. We need to add our created enum to the top of the form and created grids for each table we will want to see. We will need to make the grid not visible and add some code so the form should look like this with properties:
New form method setControls():
Override init() method on form:
Override selectionChange() method on RelationType combo box:
Override clicked() method on both New and Delete buttons:
Now we can see only those fields which belongs to specific table according to selected type:
But still every time we create record we will still need to specify in which table plus derived data sources do not show inherited fields. To be able to see them we need to add the actual tables(so in our case “Person” and “GovernmentOrganization”) to forms data source and change property data source on grids to those tables(make sure all the fields specified previously are updated as well). So it should look like this:
No we can move swiftly between different tables and create record only in which is visible at the moment. We will not see as well the dialog for selecting the type as Microsoft Dynamics AX will be handling it now by picking what is set visible.
This provides us clean and easy functionality. The advantages are:
- We will not see any unnecessary fields (previously those were greyed out).
- Records visible are only those from selected type (previously we would see all records from based table).
- We can easily add more types by extending the inheritance.
Implementing a new ERP system in an organisation is always a challenge. Users question whether they will be able to cope with analysing the data flow in an integrated system without external support. The accountant wonders whether all the set-up accounts are correct. The chief technologist cannot get rid of troublesome thoughts about whether the routings and boms are set up optimally. This is why it is so important to have a reliable service team to help the company control the system in the post-implementation stage. In this article, we take a look at the issues surrounding the implementation of an ERP system and the benefits of maintaining proactive service support.
328.77 million terabytes of data are generated every day - this is the estimate for the first quarter of 2023 (1). These are massive amounts of data on a global scale. On a smaller scale, such as an enterprise, it's difficult to estimate because it depends on the organisation in question, but one thing is certain - collecting, processing and analysing this data is the key to business success today. Why is the Data Lake service so important for data analysis and reporting in Microsoft Dynamics 365 Finance and Operations? How can you tame the data by integrating Microsoft Power BI analytics with Data Lake? We have drawn up some tips.
The retail industry is still dealing with the effects of the pandemic that lasted almost three years. In addition to this, further global events are causing disruption to the supply chain or financial stability of many retailers globally. As the industry confronts new challenges shaped by economic and geopolitical factors, it also faces trends influenced by changing customer expectations and needs. Here are 5 developments and trends to watch.
An interactive, AI-powered support for sales, customer service, marketing, and supply chain - Microsoft Dynamics 365 Copilot leverages generative AI and natural language processing technology to perform simple, yet time-consuming daily tasks that workload employees but can be automated.