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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Skip form methods without overlaying

(0) ShareShare
ReportReport
Posted on by 3,371

Hi, I am trying to skip init implementation of a form (ex: HcmPersonIdentificationNumber) without overlaying from a specific call. Is there a way to do so?

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at

    You can use extensions to *add* logic, not for removing code from existing methods or adding some extra conditions there. You would have to design your solution in a different way - let us know what exactly you're trying to achieve if you need our help. Nevertheless some things simply can't be done without overlayering.

  • Hichem.Chekebkeb Profile Picture
    3,371 on at

    We would like to extend HcmPersonIdentificationNumber as such it becoms standalone form and opens showing all id docs without going through HcmWorker form ( which filters for the selected worker), but can't be done since the init method is checking the caller dataset. Do we have to recreate the form or what do you suggest?

  • Verified answer
    Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at

    It's quite easy. If you look at how the datasource's init() works, you'll find that if you use right Args when calling the form, the filter for the current user won't be added.

    Namely:

    • Put an empty DirPerson record to Args.record()
    • Set the value of Args.caller() (it can be anything)

    init() will set common and dirPersonCaller to the empty DirPerson record, therefore the condition if (dirPersonCaller.RecId) won't be met and no range will be added.

    There is just one more trick. AX still creates a dynamic link to the record in Args, therefore you must remove it. Create a handler for the Initialized event of the datasource and call this from there:

    sender.queryBuildDataSource().clearDynalinks();

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans