Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Selected record on list page displayed on the detail form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How to get the selected record on list page, details on the detail form ?

*This post is locked for comments

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Selected record on list page displayed on the detail form

    Hi,

    Please try the following statements:

    1. Set property CopyCallerQuery to Yes and NeedsRecord to Yes on the first listpage(FormA) MenuItembutton properties.

    2. On FormB,
    In the ClassDeclaration method declare common variable 

    Common callerRecord;
    TableA tableA;

    In the init method, capture caller record

    if (element.args().parm() == formStr(CaseDetail))
        {
            custTable_ds.allowEdit(false);
        }
    tableA = TableA::findRecId(callerRecord.RecId); // or write a query based on recordId

    In the init method of tableB formdatasource
    querybuilddatasourc qbds;
    Querybuildrange qbr;
    
    super();
    
    qbds = this.query().datasourceTable(tablenum(TableB));
    qbr = SySquery::findorCreateRange(qbds, fieldnum(TableB, commanField));
    qbr.value(queryvalue(tableA.CommonField));
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: detail page form

    I have a list page and a normal form

    List page displays data of table A and the other form displays data of table B

    both the tables are related through a common field

    when I double click the grid of list page the other form opens but it shows all the data in the table B

    I want to filter the detail to be shown of that record which is double clicked on the list page

  • krishna.rao@dax Profile Picture
    krishna.rao@dax 2,953 on at
    RE: detail page form

    you need to link the details form in listpage.

    You could find same in standard forms such as salesorder,purchaseorder listpages.

    If the requirement is not similar, express more..

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: detail page form

    Hi,

    Can you provide some more details regarding your requirement. Record can be accessed through the formdatasource and you can use following code to loop through the selected records on form.

    LocalTablename localTablename; // Declare table variable

    Tablename_ds = _salesLine.dataSource();

       for (localTablename = Tablename_ds.getFirst(true) ? Tablename.getFirst(true) : Tablename_ds.cursor();

            localTablename;

            localTablename = Tablename.getNext())

       {      

           //Do your thing

       }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,387 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans