Master/Detail in Axapta

Posted on 2011-04-28
Last Modified: 2012-05-11
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.
Question by:smetechit
    1 Comment
    LVL 5

    Accepted 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

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
    Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now