How don't let left a form if a field is not informed

Leroy
Member Posts: 199
Dear folks, I this this is easy. On OnCloseForm from a form I've the code:
IF field1='' THEN ERROR:='Field field1 is empty, you must fill it';
This message shows when you try to left the form and fild1 is not informed. But this contro let to left the form. I'd like to know how do it that don't let left the form is the fild is not informed.
Thanks.
IF field1='' THEN ERROR:='Field field1 is empty, you must fill it';
This message shows when you try to left the form and fild1 is not informed. But this contro let to left the form. I'd like to know how do it that don't let left the form is the fild is not informed.
Thanks.
0
Comments
-
I recommend to not use such a way formaking some fields "required". Search the forum for that, you will find many posts about this...0
-
Thanks for recomendation, but I need it, do you know how. please?0
-
Use OnQueryCloseForm Trigger, it will solve your problem.Thanks & Regards,
Udaykumar Akunuri0 -
Perfect!!, it just work. Thanks both for help.0
-
And what about the PgUp, PgDown, listing in the entries etc. The user still can move to another record and not fill in the field...0
-
Yes you're right, normally this control will be in a form that access though another, I mean that there will be a filter; it's true that you can deselect the filter; but this is only and advise control to remember to fill fields, in my case the final responsability will be form the user.
Thanks also for your concern.0 -
For that also you can write code, While closing the form - Instead of checking the current record we will check all the records..............
Repeat
testfield(",,,,,");
unitl next = 0;Thanks & Regards,
Udaykumar Akunuri0 -
Please NOOO [-X . Can you imagine to go through whole table with tousends record just to find that all is ok when anybody close the form?0
-
Hi Kine,
You are Right, it is not a good thing if we have thousands of records(as you said). But according to my knowledge there will not be thousand of records in a form - In which a user need to feed the data......... i.e, we have only few types of tables (Master, Subsidery, Suplimentary, journal, Ledger, Documents,.......)
Correct me if i am wrong. ( i am also interesting to know where i need to improve)Thanks & Regards,
Udaykumar Akunuri0 -
Still, functionality "assuming" something is not good one. Right now, the assumption can be correct. Can you be sure that it would be still true in few years? Ways like "blocking" the record (e.g. not alowing users to "unblock" the customer until all data are ok) from using it in related processes until the data are correctly filled in is much better and there are no performance consequences and there are no problems with users looking to the card, which e.g. cannot edit the record (because have no permissions or are not responsible for that) and are blocked by error, which is vey annoying for them (because they cannot close the form, but they cannot solve the problem and needs to kill the client to leave the form).0
-
You are right Kine,
This depends on the situation and need. As Leroy told that 'he need it', i gave this way(may be a solution).
Thank youThanks & Regards,
Udaykumar Akunuri0 -
For me, in most cases words "I need" or "They need" means "I/they do not know any other way how to do that". It means that offering different ways of solution even if somebody told you "I need that" can lead to solution in the alternative way (if he is listening and open). 8)
Mr. House: "Everybody lies"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