Options

Check uniqueness of a field or declare an unique field

AmaraaAmaraa 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.

Comments

  • Options
    rnshhrnshh Member Posts: 22
    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
    ArcherPoint
  • Options
    AmaraaAmaraa Member Posts: 153
    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,
  • Options
    vaprogvaprog Member Posts: 1,118
    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.
  • Options
    AmaraaAmaraa Member Posts: 153
    Thanks all,

    It's all fine now.
Sign In or Register to comment.