2 Vendors created with same name...!!!

Dear All,

Thank you for your kind support all the time. I am using Navision 2009 R2.

When I create a vendor and at the same time if someone else creates the same vendor then system does not give error. This happens only when 2 people at 2 different systems creates same vendor. If once an vendor is created and person escapes out of the vendor card and now if someone tries to create vendor with same name then it correctly gives error. I have written below code for this.

Note: I know if sound stupid that 2 people try to create same vendor but it happens because 1 might be at warehouse and another at accounts(In this case it was in same location but may be at different systems)

Name:=UPPERCASE(Name);

Vendor.SETFILTER(Vendor.Name,’=%1’,UPPERCASE(Name));

IF Vendor.FIND(’-’) THEN

ERROR( ‘Vendor %1 already exists!’,Name);

What can I do to avoid duplication of Name in Vendor card.

Regards,

Fahim.

Have a look at the Duplicate tab and Duplicate Search String Setup in Marketing Setup

Hi Fahim

Where have you put this code?

Also be aware if there are any spaces or different spellings, your code wont be able to match anyway.

e.g. 1 - Microsoft Corporation and Microsoft Corp

e.g. 2 - Microsot Corporation and Microsoft Corporation

e.g. 3 - Microsoft Corporation and MicrosoftCorporation

Even if you capitalise these values, they want match

Hope this helps

Ideally you can not match the string as sometime it contains space ,special character and it might be written differently

In your case you try to give access to one department for creating the vendor so it can controlled and it can be control using User Setup.

This will avoid creating the duplication in data.

Thank you for your quick reply Golfer, I see in marketing setup in duplicate tab…there are 2 option ticked

1.maintain dupl. Search

  1. Autosearch for duplicate

also in setup >>“duplicate search string setup” the in field column “Name” is taken which I believe is the “Name” field of vendor table then “Part of Field” is first and “Lenght” is 5.

What do I do now???


Hi Connull, I have put this code in vendor table onvalidate of “Name”.


Hi Amol,

Yes you are right. However, we have multiple users who can create a vendor in case other is not available or just to avoid time delay(may be in some special cases) they would simply create and try to finish the work.

Thank you once again for your quick reply.

Regards,

Fahim.

Sorry forgot to reply that the name is exactly same as the old one. I guess it allowed only because they both were may be created at the same time. Because I have tried to do it at my end with two users trying to create it at the same time and it allowed…!!

Regards.

Define the search string and then enter suitable value in Search hit %. Have a look in the Online help for more details.