Check uniqueness of a field or declare an unique field

Amaraa
Member Posts: 153
Hi all,
Sorry for the simple question, but have been apart from NAV many years I can't find how to define unique field in NAV. ](*,) ](*,) ](*,)
The case is Vendor table will have an additional field that relates to the company registration number. It can be blank though, as if somebody doesn't know the registration number. But if it is populated it should be unique.
:oops: And if possible one more help please. How can I suggest the registration number from Creditor No.? However, the Registration No. field doesn't really need to take a value from Creditor No. :roll:
Thanks for all you effort.
Sorry for the simple question, but have been apart from NAV many years I can't find how to define unique field in NAV. ](*,) ](*,) ](*,)
The case is Vendor table will have an additional field that relates to the company registration number. It can be blank though, as if somebody doesn't know the registration number. But if it is populated it should be unique.
:oops: And if possible one more help please. How can I suggest the registration number from Creditor No.? However, the Registration No. field doesn't really need to take a value from Creditor No. :roll:
Thanks for all you effort.
0
Comments
-
Hi,
You'll need to have some code in the - OnValidate trigger of the new field.
Not sure about the Registration No. question. Could you explain in more detail?Tim Lecander
ArcherPoint0 -
Thank you for the reply.
Isn't there any property for checking the uniqueness? If no I will write a code that check if the entered code is previously entered.
The second thing is. Can I make have list of values to choose but will allow a user to enter other value than the list provided?
Regards,0 -
Uniqueness is only tested on a primary key. So, you might create a table with the registration number as it's primary key and set up a table relation. Or else you need to check uniqueness using C/AL code.0
-
Thanks all,
It's all fine now.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