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

Notifications

Announcements

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 636

 

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,488 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
    636 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
    636 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
    636 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard