Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

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

Posted on by Microsoft Employee

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

  • mmv Profile Picture
    mmv 11,465 on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    Hi,

    Then I think, the best solution is to modify your import tool to take care of this scenario.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    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

  • mmv Profile Picture
    mmv 11,465 on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    Hi,

    How you are inserting the records into the NAV tables?

  • Suggested answer
    aavio Profile Picture
    aavio 895 on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    notblank.PNG

    NotBlank property doesnt need any validation code.

    Can you check the documentation in the screenshot.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    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

  • mmv Profile Picture
    mmv 11,465 on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    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
    Community Member Microsoft Employee on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    Hi aavio!

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

    Taka

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

    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

  • Suggested answer
    aavio Profile Picture
    aavio 895 on at
    RE: how to force not to entry empty string to PK columns(nvarchar) by NAV Setup?

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans