web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to add range to view details button?

(0) ShareShare
ReportReport
Posted on by 843

Hello,

On the SalesTable form, I have a lookup added on the sales order line with the carTable table, which contains two fields (carId, accountNum).
Each line can have a different carId selected in the lookup for specific customer. Here everything works correctly.
But when I want to open the form of the carTable, by right-clicking and selecting "View detail". The carTable form opens, but it does not filter the lines by carId and AccountNum correctly.
It displays cars of all customers that have the same carId (it is not unique - the unique key in the carTable is carId and AccountNum).

How can I add a range here so that when I go to "View details" it displays the form only with the correct carId and AccounNum?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, You can check standard forms like LedgerJournalSetup, its adding range in datasource of form based on caller. You can replicate this logic to check if caller dataset is carTable then find the record and filter it in your form.

    pastedimage1683288872990v1.png

  • Shooowtek Profile Picture
    843 on at

    Thanks. I'm trying to customize my form suggested by your standard solution, but I'm getting a error that my form doesn't contain a 'query' method....

    ClassDoesNotContainMethod: Form xxx does not contain a definition for method query and no extension method query accepting a first argument of type xxx is found on any extension class.

    Which query() is required?

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Please share your code and form structure (Datasource and design)

  • Suggested answer
    GirishS Profile Picture
    27,829 Moderator on at

    Hi Shoowtek,

    You can get the caller record and add range using element.args().lookupValue() or lookupRecord  - This will return the caller record when you click on view details.

    Thanks,

    Girish S.

  • Shooowtek Profile Picture
    843 on at

    Hi,

    Overriding the jumpRef method solved the problem.

    Thanks.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 622 Super User 2025 Season 2

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 438 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 354 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans