Nav 4.1 - Form ReadOnly Control

doddwelldoddwell 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

Comments

  • vaprogvaprog Member Posts: 1,141
    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.
  • doddwelldoddwell Member Posts: 65
    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.
Sign In or Register to comment.