Nav 4.1 - Form ReadOnly Control
doddwell
Member Posts: 65
Hello
NAV 4.1
Created a form with a Menu Option Button. As default, the form opens in Readonly mode. User clicks the Menu button and chooses an option "Enable/Disable Edit". This toggles the form between Readonly and Write modes.
If the user has the form in Write mode, and then moves to a different record, I would like the form to automatically revert to ReadOnly mode. I tried to achieve this by adding some code to the OnAfterGetCurrentRecord() to set the form to ReadOnly. The problem is that the OnAfterGetCurrentRecord() Trigger fires after the user presses the Menu Option Button and sets the form to Write Only.....so it automatically sets the form back to ReadOnly (so can never get into Write mode).
Any ideas how I can achieve what I'm after?
Thanks, Simon
NAV 4.1
Created a form with a Menu Option Button. As default, the form opens in Readonly mode. User clicks the Menu button and chooses an option "Enable/Disable Edit". This toggles the form between Readonly and Write modes.
If the user has the form in Write mode, and then moves to a different record, I would like the form to automatically revert to ReadOnly mode. I tried to achieve this by adding some code to the OnAfterGetCurrentRecord() to set the form to ReadOnly. The problem is that the OnAfterGetCurrentRecord() Trigger fires after the user presses the Menu Option Button and sets the form to Write Only.....so it automatically sets the form back to ReadOnly (so can never get into Write mode).
Any ideas how I can achieve what I'm after?
Thanks, Simon
0
Comments
-
Try to remember the record active when the menu option is used and check whether it is the same in OnAfterGetCurrentRecord. Or maybe remember it in OnAfterGetCurrentRecord, so the form does not revert to non-editable on refresh e.g. after it regains focus. Some special handling might be needed to handle new records, both initiated by New(F3) or by navigation beyond the end of the list.0
-
Vaprog. Thanks for your response. I'm building a Function along the lines of what you suggest. If I ever get around to finishing it, I'll post it here.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
