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
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 .
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:
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!
Hi,
You can use field on change event handler by going to form editor field properties.
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?
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?
Hi ,
The addonkeypress event is now deprecated and will not be supported on the unified interface. Use onchange instead of addonkeypress.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156