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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model driven app event...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 672

 

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

 

 

 

I have the same question (0)
  • Guido Preite Profile Picture
    1,490 Super User 2024 Season 1 on at

    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

  • Verified answer
    a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello, try to use the following syntax:

    const dobFieldControl = formContext.getControl<Xrm.Controls.DateControl>("fieldname");
    dobFieldControl.setNotification("whatever");
  • westerdaled Profile Picture
    672 on at

    @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");

     

  • westerdaled Profile Picture
    672 on at

    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 . 

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    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
    672 on at

    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"); 

     

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard