• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1278
  • Last Modified:

Master/Detail in Axapta

I want to create master detail form to display and manipulate monthly sales target.

The master table contains two columns of EnumType (Year, Month)

The details table contains (Year, Month, Warehouse, SalesTarget)

How to link the two tables with using the two fields (year, month) so that salecting year and month from master filter the details and insert (year, month) with new details records i.e, user will enter only (warehouse, SalesTarget)

By the way I could insert year and month in details table by overwriting the create method of detailed datasource

public void create(boolean _append = false)
    RepresentativeTargetLine.Year = RepresentativeTargetTable.Year;
    RepresentativeTargetLine.Month = RepresentativeTargetTable.Month;


But I have troubles with filtering and master records scrolling.
1 Solution
I'm not entirely sure why you need the master table with year and month in them as it seems superfluous to me, you only need the targets table and the form containing the unbound year and month fields.

See Attached Project although in my case I useded the Dimension (Branch) rather than the InventLocation (Warehouse), but I trust you can work your way around that.

Essentially Apart form adding the controls to the form what has been changed is in the class declaration of the form and it's 'init' as well as the 'modified' methods on the year and month controls and most importantly the executeQuery of the sales target datasource.

I also left the Year and Month columns in the grid so you can see without adding any code it defaults to the filtered values.

P.S. You might want to rename the file with an XPO extension instead of XML before importing the project.

HTH SharedProject-SalesTarget.xml
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now