web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

(0) ShareShare
ReportReport
Posted on by

Hi, all. i have a question.

Regarding as Customer table(for example) if you know, could you please tell me about how to force not to entry empty string in PK(No_) without Validation in NAV environment?

in my situation,

my customer always entry some data in Customer table, that Bill-to Customer No is empty string because of not inputting Bill-to Customer No.
they use No Series and manual Code both that's why No Series setup is manual [yes].

someday unfortunately they have one data that is empty String in Customer_No by their miss-operation or something like that.
after that they changed empty string to one code issued by No. Series.
they didn't notice anything at that time, but all customer data's Bill-to Customer No had changed the Code from empty string, completely every Customer data.

at the end of month, they spent so many hours for recovering some posted document and customer data...

they don't want to happen this situation again.
and they are hoping NAV Setup that they don't have one data that is empty String in Customer_No any more in case of that situation.


they don't want to change setup of No Series manual [No] also, they use both.
of course i know that each columns have table definition parameter [Not Blank] but it becomes effective only validation, 
and i also know they can setup table definition using check constraint in SQL Server directly but i don't know influence to NAV environment...

they would like to setup NAV to force not to entry empty string...

they are using NAV2015R2/CU9. they have more than 80,000 customers data and increasing 300 customers every month. i have to take the action early. 


if you knew some idea or clue or something, could you please help me about it?

Thanks Regards,
Taka Saito

*This post is locked for comments

I have the same question (0)
  • mmv Profile Picture
    11,471 on at

    Hi,

    You may write a code to throw an error in the OnQueryClosePage trigger on the page if the field is blank.

  • Suggested answer
    aavio Profile Picture
    895 on at

    please test with NotBlank property on the primary key field set to yes.

  • Community Member Profile Picture
    on at

    Thanx Mahesh!

    your solution is only action of the page... so i would like to set trigger or constraint like that on Table without validation via NAV...

    Taka

  • Community Member Profile Picture
    on at

    Hi aavio!

    but i had already tested that property, it doesn't work without validation...anyway thanks.

    Taka

  • mmv Profile Picture
    11,471 on at

    Hi,

    If it's in the table, it's pretty easy, you need to write a code to check the blank value in the OnInsert trigger or OnModify.

  • Community Member Profile Picture
    on at

    Hi Mahesh,

    my understanding about OnInsert & OnModify on table, it works on Validation. the key point is without Validation. so do you have any idea for that? thanx!

    Taka

  • Suggested answer
    aavio Profile Picture
    895 on at

    notblank.PNG

    NotBlank property doesnt need any validation code.

    Can you check the documentation in the screenshot.

  • mmv Profile Picture
    11,471 on at

    Hi,

    How you are inserting the records into the NAV tables?

  • Community Member Profile Picture
    on at

    Hi aavio,

    i had already read that documentation before and tried it. but it doesn't work without validation. have you tried it before?

    Taka

  • Community Member Profile Picture
    on at

    Hi Mahesh,

    we Japanese localization have data import tool, that is able to select on validation or without(skip) validation, that's why i can test whenever.

    finally we hope the situation that we are not able to have empty string(Blank) in PK columns(nvarchar) like Customer No without validation, always, every time.

    if you have some solution, please help me thanks.

    Taka

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans