Adding field to module (after module is already registered) - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Adding field to module (after module is already registered)

  • Adding field to module (after module is already registered)
  • Hi,

    I have developed an OpenAccess module for case studies. I have registered it in my sitefinity web app and everything is running nicely - however I now need to add a field to it, not a custom field added via the UI, but a physical coded field.

    Can I do this without first unregistering the module? If so, how do I do this seeing as there is no built-in method?

    Likewise, over the next few days Im looking to upgrade to 4.1 and I know I need to make changes to the mapping of persistent classes - again, will I need to unregister my module first?

  • Hello higgsy,

    You don't need to un-register your module to introduce new code based custom fields. This is valid for both 4.0 and 4.1. I strongly suggest to first migrate your module to 4.1 since we will not be able to support problems with the 4.0 modules from now on and the ORM mapping is completly changed.
    How this works in 4.1: Once you change dll-s of your module and restart sitefinity, upon intialization of your open access data provider, sitefintiy checks the build numbers of the assemblies that incude persistent classes mapped in your provider. If these build numbers have changed from the pervious initalization - it will test the database for consitency versus the new ORM model and if necessary upgrade - add columns, tables, indecies etc.. Hence if you add new fields and ORM mappings to your module you simply have to make a build of your module assembly with higher version than the previous ,copy the binaries in bin and restart sitefinity.

    Best wishes,
    Nikolay Datchev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>