Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I have an existing post for a setFocus issue but not related to this particular post.
I've not worked with the frontend all that much. We have a custom form which contains a particular Real control. In a method on the form a calculated value is set to this control, then I call setFocus() to bring the focus to this control. All this working fine to this point. Where it falls apart is, with this control having the focus, I type in a different value and hit enter which should call modified() and recalculate the updated value. Instead the focus jumps to a different control. If I tab back to this field and change the value now, then the code kicks in and updates the value.
Adding a breakpoint to the modified() for this control shows that it isn't called after the initial value change.
Is there an additional parameter I need to set for this control prior to putting focus on it?
I too have this same issue where modified() is not being called after setting focus in the field. Only way to make it call modified() is clicking within the field first before hitting enter.
Are the controls you are using bounded fields? Because I just tested with unbounded fields and it seems to work. Setting a value, setFocus(), modifying the value again, and hitting enter called (in my case) modified().
Forms can be a bit of a nightmare if you do not know where to look.
For example, before calling modified, it will call validate, and if this is data bound, it will also call the validate / modified on the data source.
In a simple scenario, the setFocus will work.
You will probably find that something is conflicting with your will in an override method that is being called earlier in the process.
Hope this helps ;)
For my situation, all of the string edit controls are unbounded. I've set a breakpoint in my modified method and tried it both ways. Only time the breakpoint is hit is when I click with in the field then scan input into the field. We are on AX 2012 RTM CU3.
The override sequence is something like - Task / SelectControl / Validate / Modified
There are more than these, but I would need to examine a form object to recall further details on this.
Try your break point in one these I have mentioned, and follow the code to see why you never reach your modified method?
Thanks dynamic_jay. Considering the form is so simple, I just enabled the Skip property on the fields that are informational only and removed the setfocus() calls. The form now works the way I want it when scanning values using a barcode scanner keyboard wedge.
Business Applications communities