An editable field on a non-editable form

tinoruijs
Member Posts: 1,226
Today I 'discovered' a nice litte trick. Thought I'd share it with you.
It was necessary to have an editable field on a non-editable form.
In the OnAfterGetCurrRecord on the form there is the following code:
So if status is released the form is non-editable.
But 1 field still has to be editable...
In the OnActivate of the field I put:
In the OnDeActivate of the field I put:
Simple. But effictive.
It was necessary to have an editable field on a non-editable form.
In the OnAfterGetCurrRecord on the form there is the following code:
CurrForm.EDITABLE(status = status::open);
So if status is released the form is non-editable.
But 1 field still has to be editable...
In the OnActivate of the field I put:
CurrForm.EDITABLE(TRUE);
In the OnDeActivate of the field I put:
CurrForm.EDITABLE(status = status::open);
Simple. But effictive.
Tino Ruijs
Microsoft Dynamics NAV specialist
0
Comments
-
Is it for List or Card form ?0
-
It's funny, never thought I would need this before.
Then I see the post and guess what a week later it's needed.
Thanks.0 -
This looks good.
Problem with activate and de-activate events in NAV, they get triggered when you don't expect it.0 -
Great for Booleans since no other entry is needed other than a click
OnActivate()
CurrForm.EDITABLE(TRUE);
OnDeactivate()
CurrForm.EDITABLE(FALSE);0 -
This is a good solution but i have experienced some problems with it.
Sometimes i get an error message "<table name> cannot be changed in this form" while using it.
Maybe there's something else i've got wrong, just pointing it out...0 -
Stijn Mattheus wrote:This is a good solution but i have experienced some problems with it.
Sometimes i get an error message "<table name> cannot be changed in this form" while using it.
Maybe there's something else i've got wrong, just pointing it out...
Probably you're changing the current record through code and you'll need a CurrForm.UPDATE when you return on the form.
Tino Ruijs
Microsoft Dynamics NAV specialist0 -
Depending on the license there are tables you cannot change regardless of it being set to editable yes or no. like ledger entries n such.
for example,you need the item list to be non-editabl else people can be changing things by accident. but if you wanted to be able to change the blocked field only in the list then you might use such a code.0 -
It's good, if we want only some filed to be editable on the form we can do it by making EDITABLE Property True for that fields and for others it will be false, its is simplest way if it is available then why to write code if objective is achived by using property =P~
Pranav
Pranav Joshi
MS Dynamics NAV Consultant
SBS Group Desert Mountain (Formerly Silverware Inc.)0 -
Remember to turn off InsertAllowed and DeleteAllowed AND remember to set any other field noneditable that you add to the form and it will be OK.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions