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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get the caller form name from form datasource table init method

(0) ShareShare
ReportReport
Posted on by 126

Hallo,

I created an extension from an init method of a datasource, I've use this code below but when I execute the form I'm getting an error.

element.args().callerFormControl().name()

Is there another way to call the caller form name from a table datasource?. Thank you!

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    Just saying that you're getting an error isn't sufficient. Please tell us whether it's a compilation error or a runtime error, what error message says and which of the statements it's related to.

    In either case, callerFormControl() doesn't give you the caller form. Use caller() method instead:

    FormRun callerForm = element.args().caller() as FormRun;
    if (callerForm)
    {
        ...
    }

  • Josh_ Profile Picture
    126 on at

    Hi Martin,

    Thank you for the code snippet, it seems that I did not put the "as FormRun" on my code thats why I get an error, sorry my bad.

  • Verified answer
    Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    "as FormRun" doesn't make any difference if the caller is a FormRun object. If it isn't, it'll set the value to null, and therefore the "if" condition won't be met.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 423 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans