In our erp system we can see If a object (Customer, Address) is already existed then system doesn’t throw exception. Instead it’s created object adding a number (increment) tailing of the name field.
For an Example:
name
is the primary key for Customer
. XYZ customer is already exist in our system now I’d like to create another customer with the same name XYZ then system showing following message:
Changed customer name to 'XYZ - 1' as 'XYZ' already exists.
Our expectation is system should throw an exception and prevent customer creation.