Unique field in a custom Data List

cancel
Showing results for 
Search instead for 
Did you mean: 
june_cataquez1
Active Member

Unique field in a custom Data List

Hello Alfrescians,

I was able to make a custom Data List and I have an issue regarding duplicates, is there a way to make a specific field in my custom made Data List to be unique?

Please refer to the attached file.

Best Regards,

June

4 Replies
jpotts
Professional

Re: Unique field in a custom Data List

The only way I can think of would be to write a behavior that binds to your custom data list type, looks at your property value, searches to see if another instance of a data list item exists with that property value, then throws an exception if it does.

Or you could handle it with a custom form control or some other client-side JavaScript that would invoke an AJAX call to a web script that would do the same search and then throw a form validation error or something depending on the result of the AJAX call.

june_cataquez1
Active Member

Re: Unique field in a custom Data List

Hello Sir,

Thanks for sharing the idea, these presented ideas are new to me Sir, and can I ask another favor? can you share some documents/links on how to do these? All I need is an introduction/overview and an example in implementing this. Thank you so much.

Best Regards,

June

jpotts
Professional

Re: Unique field in a custom Data List

douglascrp
Advanced II

Re: Unique field in a custom Data List

The project contentreich-alfresco-datalists/contentreich-extdl-repo at master · deas/contentreich-alfresco-datal... offers that option to generate an unique ID for datalist items.

Take a look at the source code and you will find all you need to implement the behaviour.

The only thing missing will be the check for repeated values.