cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic value from Database in one of the field of content model

patil
Champ on-the-rise
Champ on-the-rise
I am using Alfresco 4.1.9.

I have the requirement for connecting to database to fetch the possible Dynamic values from Database in one of the field of content model.

Lets say I have the content model type as patil:book having the property patil:author.For the patil:author field , I need to list all the possible authors by connecting to DB. End User will select any one of the author and store the book of the type patil:book.


What approach I should follow for this?


I tried Form Filter, it is of not much help

Thanks,
Patil
1 REPLY 1

hardik1512
Star Contributor
Star Contributor
Hello Patil,

You can create a custom constraint that extends ListOfValuesConstraint and fetches allowedValues from database. And then you apply this constraint to patil:author property in your model file.

You can find a good example here.
http://govindaroul.blogspot.in/2013/10/dynamic-list-constraints-in-alfresco.html

Hope this helps.