Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Model driven app event handler project is missing some standard control methods such as setNotification

(0) ShareShare
ReportReport
Posted on by 616

 

I have set up a folder structure for creating some event handlers in TypeScript.

 

I have installed node types

npm install @types/node --save-dev

and xrm types

 

npm install @types/xrm --save-dev

 

In my form.ts . my event handler code works but in the intellisense, I appear to be short changed 😒 , as I am missing some key methods such as setNotification on my dob control ... Anybody seen this before

 

event handler issue.png

 

 

 

Categories:
  • westerdaled Profile Picture
    616 on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    I can confirm I can define the date control in a couple of ways and still ensure I am able to send notifications. 

     

     var dobFieldControl1 = formContext.getControl<Xrm.Controls.DateControl>(dobFieldLogicalName); 
     dobFieldControl1.setNotification( "First syntax","whatever"); 
     
    
    const dobFieldControl2 : Xrm.Controls.DateControl = formContext.getControl(dobFieldLogicalName); 
     dobFieldControl2.setNotification( "Second syntax","whatever"); 

     

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    I believe that was done because some of the controls do not have notification capabilities like iframes and subgrids.

    And you can click "Accept as Solution" to close the thread.

  • westerdaled Profile Picture
    616 on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    Hi thanks,

     

    I will report this to them. Does seem very confusing given the form control works fine with out needing to cast to a XRM type . 

  • westerdaled Profile Picture
    616 on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    @a33ik 

     

    Yes this does work, with no type issues.  So are we casting to the correct type with this syntax?

     var dobFieldControl1 = formContext.getControl<Xrm.Controls.DateControl>(dobFieldLogicalName);
     dobFieldControl1.setNotification( "eee","whatever");

     

  • Verified answer
    a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    Hello, try to use the following syntax:

    const dobFieldControl = formContext.getControl<Xrm.Controls.DateControl>("fieldname");
    dobFieldControl.setNotification("whatever");
  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at
    Re: Model driven app event handler project is missing some standard control methods such as setNotification

    the package types/xrm is not created by Microsoft but from the community, the GitHub project should be this one https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xrm

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics