Drag and drop grid functionality in AX 2012Continue reading
Drag and drop can be achieved by using different styles on form like: tree control or list panel control as those types of approach can be very easy from development perspective sometime they can be not so user friendly.
Let's imagine a situation where we have requirement to see customers and their contacts in new form and in it we should be able to freely remove contacts from customer and add them again. This can be easily achieved by list panels:
But we can see that more columns we add to list panels the less readable it becomes. How can user distinguish between different columns? The same goes for tree control more information we add the less readable it becomes from user perspective. What we can do to allow users easy access to add/remove contacts and to make it more user friendly is use drag and drop functionality on grid properties.
To start off lets created simple form to show all the customer records, add CustTable as new data source and add three new fields to grid – customer name, account number and phone:
Name and phone are display method from customer table, our form looks like this:
Now we will add twice as the data source the table ContactPerson, let's call one ContactPersonAllocated and other ContactPersonNotAllocated:
Both should have those properties set:
Now create 2 new groups under existing grid, one for horizontal split:
Initialize splitter in code:
Override three methods on Split group control:
Second group to store our tables for drag and dropping – this group will hold two new grids and splitter group between them:
Properties to change for each of new elements:
Splitter again should be initialize in code:
Now we can add some fields to our grids, in my presentation I have used some base information to present Id, names, address and phone number of contact listed in each grid, we need to make sure that in each grid fields are taken from correct data sources:
If we opened form now we would see the same information in both grids so we will add some range in both data sources. Let's start with contacts which belong to customer, so the “ContactPersonAllocated” data source, declare new range and override init() and executeQuery() methods on data source:
And for the second “ContactPersonNotAllocated we will follow the same procedure with new range:
As last step for range we need to override active() method on CustTable data source:
Now our form will show on left contacts assigned to customer and on the right the contacts not assigned. So now final steps for our drag and drop functionality, we should have on both grids property “DragDrop” specified as “Manual”. On each grid methods override the drop() method as this is where we will be changing the records.
We want to add reference between contact and customer when we drop the contact from right to left and refresh the data to show correct values. And When we move contact from left to right we want to remove the connection so let’s write new method in form methods called updateContact():
Now add code to drop() method on grid where we show allocated contacts:
And to drop() on grid with not allocated contacts:
Final view of form:
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.