Unique field value via IDataEvent ? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Unique field value via IDataEvent ?

  • Unique field value via IDataEvent ?
  • 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

  • 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
     
  • 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

  • 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