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

Element is not declared.

(0) ShareShare
ReportReport
Posted on by 110

Hi,ElementError.png

I am using the extension to extend the run method of a form please, guide me how I will use the element, thanks. Please find the screenshot.

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Use keyword "this" instead.

  • Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at

    By the way, don't use form names hard-coded as strings. Such as:

    formRun.name() == "ProjTransEmpl"

    Use formStr() instead:

    formRun.name() == formStr(ProjTransEmpl)

    If you use formStr(), the compiler will check if such a form exists and it'll also include the reference in cross-references.

  • Verified answer
    Blue Wang Profile Picture
    on at

    Hi Muhammad,

    Yes, You should change "element" to "this".

    The ‘this’ object in your extension contains the element object (FormRun) of the extended form, so you can query for elements and data sources easily from here.

    If you still have problems, please share with us in time.

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
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans