Troubleshooting: Failed to create UDF

From AutoCount Resource Center

Question : When I try to create a new UDF, system prompts error message during save – “Unknown Sql Exception (Number=1505, Message=The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.DODTL' and the index name 'UK__DODTL__UDF_TICKET'. The duplicate key value is (<NULL>).” Why?

Version : 1.8 / 1.9 / 2.0

Udf fail1.jpg


Possible Reason :

You’re trying to create an UDF with Unique behaviour. If you’ve more than 1 record for the entity that you are trying to create the UDF with, it will always prompt this error. The reason is because if this column is added as unique into the table, by default the column will be filled with NULL value, which violates the Unique behaviour and thus prompting you the error.

Udf fail2.jpg

Udf fail3.jpg


Solution :

1) Create your UDF without Unique behaviour first.

Udf fail4.jpg


2) Edit the previous Delivery Order and key in the value in the new UDF column and click on Save.

Udf fail5.jpg


3) Edit the UDF and enable the Unique behaviour, click on OK and Save.

Udf fail2.jpg


By : Jae Sen 180814, Lay Swan 180823, P180823



Go to menu

IconAcc20.PNG AutoCount Accounting 2.0 & 2.1


IconAcc188.PNG AutoCount Accounting 1.8 / 1.9
Wiki-Payroll.png AutoCount Payroll
Wiki-POS.PNG AutoCount POS


Wiki-AOTG.PNG AutoCount On The Go
Wiki-Accounting-Plugin.png AutoCount Accounting Plug-In Documentations