Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

Posted on by Microsoft Employee

Greetings All,

I'd like to ask if someone has had an issue with addOnKeyPress in Unified Interface(Customer Service Hub) for MSDCRM 365 Online. 

The keypress function that is not executed is pretty simple:
executionContext.getFormContext().getControl("telephone1").addOnKeyPress(

function(ext)

{

alert("Telephone: " + executionContext.getFormContext().getControl("telephone1").getValue())}

);

There are not any errors on the console. Just the event is not fired when changing the value inside the Telephone filed. I've tried also with some of the Address fields and also with custom Single Line of Text fields.

Thank you in advance!

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    This is by design , for the filed properties  you can add only onchange event. You can add onchange event by clicking on + Add icon and mentioned method name over there .

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    Hello Goutam Das,

    I see, but there in the Field Properties for a Text field, there is only OnChange event available in the Unified Interface form:


    7433.Screenshot_5F00_1.png

    There is no option for an event to be fired on every symbol entered in the field. Or just I'm wrong? If this is the case could you please assist me adding such kind on an event for a Text field?

    Thank you in advance!

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    Hi,

    You can use field on change event handler by going to form editor field properties.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    Hello Goutam,

    Thank you very much for your prompt input!

    If I've understood you correctly, you mean that should be used:

    executionContext.getFormContext().getAttribute("telephone1").addOnChange(
    
    function(ext)
    
    {
    
        alert("Telephone: " + executionContext.getFormContext().getControl("telephone1").getValue())}
    
    );

    But the issue here is that I need of an event to be fired on every symbol entered in the field not only at the end of the change when the focus is lost from the field.

    Could you please suggest me how to achieve this?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    Hello Goutam,

    Thank you very much for your prompt input!

    If I've understood you correctly, you mean that should be used:

    executionContext.getFormContext().getAttribute("telephone1").addOnChange(
    
    function(ext)
    
    {
    
        alert("Telephone: " + 
        executionContext.getFormContext().getControl("telephone1").getValue())}
    
    );

    But the issue here is that I need of an event to be fired on every symbol entered in the field not only at the end of the change when the focus is lost from the field.
    Could you please suggest me how to achieve this? 


  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: addOnKeyPress doesn't work om Unified interface for MSDCRM 365 Online

    Hi ,

    The addonkeypress event is now deprecated and will not be supported on the unified interface. Use onchange instead of addonkeypress.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans