List panels without tabs AX 2012

Continue reading

List panel can be very useful functionality especially from user perspective.

The standard Dynamics AX 2012 tutorial form shows how to initialize list panel control but with standard use of tabs “Overview” and “Panel” which is useful in situation like assigning specific roles to user but sometimes we might require list panels to be initialized without tabs. We have scenario when we need mark some of vendors as temporary vendors, they will be only used within specific time. We have separate tables to store temporary vendors and their times of being active.

Query Table

We want to shows those temporary vendors under Purchase ledger in new list page.

Show temporary vendors.

List page is standard VendTableListPage form with range showing only those suppliers with existing record as temporary vendor.

Instead of “New Supplier” we will have “New Temporary vendor” under which we will have new form with use of list panels.

Adding New Temporary Vendor.

We will start off with creating simple from and adding two new data sources:

Creating form with two additional data sources.
Properties of VendTable table.
Properties of VendTableTemp table.

Create group to hold the list panel:

Creating group to hold list panel.
Properties of ListPanel group.

Now we will do coding, we need to prepare three new methods that out list panel will use – one for catching suppliers that aren’t temporary, one for catching only temporary vendors and one for validation:

temporaryVendors() method.
suppliers() method.
validate() method.

You may notice in both temporaryVendors() and suppliers() methods we passes data about AccountNum twice we did this as we will use this field as our data field in initialization of our list panel in init() of form methods:

FormRun class.
init()

If we opened form at this point we will notice that list panels are there but they not filled in up to this point the steps are quite similar to creating list panels from tutorial form the difference is where should we put our fill() method for list panels, in this example we create new method called updateListPanel() and use it in run() method of form:

updateListPanel() method.
run() method.

We have now list panel with suppliers filled in and the temporary vendors empty as we don’t have any records yet but before we start playing we need to add more code so when we create the temporary vendor it will create time related record as well.

In my table VendTableTemp I have method for creating or updating the time related records:

VendTableTempTime

I put this method in insert() and delete() method of the same table as those methods will be called whenever I move supplier to temporary vendors or remove him:

insert() method.
delete() method.

No our form works how we wanted to but the original list page form is not refreshing after adding values so we need to add refreshing code to close():

close() method.

Final view of the form and tables:

Tree-view of VendTableTempCreate() methods.
Tree-view of VendTableTemp() table.
Tree-view of VendTableTempTime() table.
More articles
Explore our blog

What can we do for you?

We'd love to hear about your project. Our team will get back to you within two working days.

Thank you for inquiry, we’ve passed it to our sales department, our representative will reach you back in his earliest convenience.
Oops! Something went wrong while submitting the form.