Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to add range to view details button?

(0) ShareShare
ReportReport
Posted on by 737

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?

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: How to add range to view details button?

    Hi,

    Overriding the jumpRef method solved the problem.

    Thanks.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: How to add range to view details button?

    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.

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: How to add range to view details button?

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

  • Shooowtek Profile Picture
    Shooowtek 737 on at
    RE: How to add range to view details button?

    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?

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: How to add range to view details button?

    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

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…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans