Hi Folks,
Is there any way where the addOnKeyPress event can trigger on dynamics 365 mobile app. If yes , Kindly suggest what all do I need to add/ remove from entity or let me know the correct solution.
*This post is locked for comments
The addonkeypress event is now deprecated and will not be supported on the unified interface (mobile included) - the way forwards will be to create a custom control when the framework is out of preview. Until then your only option is to use a custom html webresource in the form. See docs.microsoft.com/.../webpage-html-web-resources
Based on the MS article KeyPress methods are not available on mobile clients docs.microsoft.com/.../gg334266(v=crm.8)
Sorry I have not tried , may be you can try to use onchange then instead of onkeypress.
Hi Goutam,
Thanks for the response.
I have used the same way what you have suggested and things are working fine in desktop. The problem I am facing is, when we try the same functionality in mobile app (Dynamics 365 Mobile App), the script is not getting triggered.
Do you have any other option ?
Hello,
You can add similar way like the way you are attaching form event in the Main form . Normally when Xrm.Page.getControl("FieldNAme").addOnKeyPress line will execute its automatically attach the function with the field , there is no separate event properties for that . Here is the few steps you need to follow -
1. Create a function in a JS webresource and add the line with addKeypress event attach to the control.
2. Add the JS web resource in the form library.
3. Register the funtion (onLoadAddKeyPressSample) in the form onload by going to form properties.
function onLoadAddKeyPressSample()
{
Xrm.Page.getControl("FieldNAme").addOnKeyPress(function(){
alert("Hello World");
});
}
===============
OR
==============
function onLoadAddKeyPressSample() { Xrm.Page.getControl("FieldNAme").addOnKeyPress(YourFunctionName); } function YourFunctionName() {
//Add logic here }
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156