NotBlank in condition...

Pavlos
Member Posts: 19
Hi to all,
I have a rather simple question. What I want to achieve is to force the user to enter a value in some specific fields if a condition is met. More precisely on the order form if the customer is a foreign customer then I want to make sure that the user will fill some specific fields on the order form (ie Sales Header). I’ve used the TESTFIELD on the onBeforePutRecord trigger but the problem is that it closes the form on error. What I want is to prompt the user in which field(s) he/she has to enter a value and not close the form. The record should not be saved until the required fields are filled.
Thanks in advance.
I have a rather simple question. What I want to achieve is to force the user to enter a value in some specific fields if a condition is met. More precisely on the order form if the customer is a foreign customer then I want to make sure that the user will fill some specific fields on the order form (ie Sales Header). I’ve used the TESTFIELD on the onBeforePutRecord trigger but the problem is that it closes the form on error. What I want is to prompt the user in which field(s) he/she has to enter a value and not close the form. The record should not be saved until the required fields are filled.
Thanks in advance.
0
Comments
-
Open the table in design, select the field, open the properties page, find the NotBlank property and set it to Yes. That should do the trick.0
-
Hi DenSter,
thanks for your reply. What I want is to make a field mandatory if a condition holds. For example to check the country of the customer and if the customer is a foreign customer then some fields will become mandatory and the user should notified that he has to fill in these fields. If the customer is not a foreign customer then these fields can be left blank.
Any ideas?0 -
Well the simple solution would be to require the user to enter the other fields before he's allowed to change the country, and that would be accomplished in the OnAfterValidate trigger of the field in the table. I wouldn't do any of this on any of the form triggers. That way, if you add the table to another form, the same behaviour will happen on the new form.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