Unique field value via IDataEvent ?

Posted by Community Admin on 05-Aug-2018 10:55

Unique field value via IDataEvent ?

All Replies

Posted by Community Admin on 02-Jul-2016 00:00

In the case of Dynamic Modules created via Module Builder, the default "Title" field is unique.

If I want to make other fields in a Dynamic unique, do I look to use the IDataEvent to do that?

 

Thanks

Posted by Community Admin on 04-Jul-2016 00:00

Hi,
Thank you for contacting us.

You can choose another (short text) field as an identifier for your custom content type, but as this refers to the primary key, you can only pick one.
Could you maybe elaborate on your enquiry or explain what you are trying to achieve? 

More on dynamic content type:
http://docs.sitefinity.com/create-a-dynamic-content-type

Thanks for your cooperation.

 
Regards,
Dimitri Cools
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 05-Jul-2016 00:00

Thanks for the response .... I wanted to have the ability to control entries that would be unique in two fields .

 

A good example of how to do it is here  ... but I have not been able to find info on how to send an error back to the UI if I want to reject the entry

d10fqi5lwwlsdr.cloudfront.net/.../add-logic-when-user-post-a-blog-post-in-back-end

Posted by Community Admin on 06-Jul-2016 00:00

Hi,
Please have a look at following forum thread also on Handling and adding a new item event:

http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/handling-an-adding-new-item-event-in-dynamic-module

You should be able to override the ExecuteOnPublish() method and validate. In there you can throw an exception when a setting will be overwritten. 
This exception will be shown as a pop-up in the back-end UI.

Regards,
Dimitri Cools
Telerik by Progress

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed