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 :
Microsoft Dynamics CRM (Archived)

Dynamics CRM - Object does not support property or method 'addOnKeyPress'

(0) ShareShare
ReportReport
Posted on by 20

I am working on Dynamics CRM 9.1 version.

I have requirement to AutoComplete  a single line text filed 'Country' on 'Address' entity(OOB entity).

I was trying Xrm.Page.getControl("country").addOnKeyPress(keyPressFcn) on load, but i see error message that - Object does not support property or method 'addOnKeyPress'.

But when I try 'addOnKeyPress' method on Account entity it was work as expected. 

Any suggestion how can I achieve the same on 'Address' entity(OOB entity).

4478.Account-entity.png

7317.Address-entity.png

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Ben Thompson Profile Picture
    6,350 on at

    Not a comment on your actual question but why are you using  Xrm.Page when it's be deprecated and you really should be using formContext instead?

    I don't know how supported addOnKeyPress was but the autocomplete functionality is now available on a singleline text field as part of the unified interface (which is probably the standard interface once 10.0 is released in April). www.inogic.com/.../controls-in-dynamics-365-for-mobile-app-auto-complete shows how to enable it (note at the time it was only available for mobile and tablet - it's now available for the web  as well.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Agree with Ben, the old style auto complete is now deprecated which includes  addOnKeyPress, removeOnKeyPress, showAutoComplete & hideAutoComplete . The recommended way is to use the custom control for auto complete.

    You can refer this - docs.microsoft.com/.../important-changes-coming

    Hope this helps.

  • Suggested answer
    Srini1242 Profile Picture
    20 on at

    Well Thanks Ben, as you suggested addOnKeyPress is also on the list of deprecated API's

    [View:https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming#some-client-apis-are-deprecated:750:50].

    So it is better to use 'Custom Control'

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans