Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Code to avoid Duplicate records

(0) ShareShare
ReportReport
Posted on by 10

When we create new customer in business central, at the time of new record, if Customer name and email is similar with other previous customers, then system will populate notification that record already exits.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Code to avoid Duplicate records

    I would be a little careful with implementing a function like this because i think it can be hard to really make it work in a good way for the users.

    What f.example with customers having branch offices where only the address is different?

    And be careful so you do not break any logic that might be used later for creating customers from other sources than manual input.

    In the standard system there is a merge function that can be used to merge customers if you for some reason got a doublet.

    pastedimage1660948481375v1.png

    In my experience it is better to create a page that can show go to from time to time that can show you potential doublets and then you can check if they actually are doublets or not.

    I know many users wish for functions like this when they are new to a system, but then after a while they really don't see a need for it any more.

    But Josh have given you a good approach if you really want to go ahead with it.

  • Suggested answer
    JAngle Profile Picture
    95 on at
    RE: Code to avoid Duplicate records

    Is this a request for code to perform this? I’d think a codeunit with event subscribers to both fields OnAfterValidate is a good start. You can then create a subsequent procedure in the codeunit that creates a notification. Follow this guide: docs.microsoft.com/.../devenv-notifications-developing

    This blog has same code relating to notifications: https://yzhums.com/4120/

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans