Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > How to add custom field in cms_document table. View modes: 
User avatar
Member
Member
Lokendra Jain - 6/26/2013 1:16:16 AM
   
How to add custom field in cms_document table.
Hi All,

I am working with kenitco cms 7.0. I have implemented advance search by creating custom search result web part . I am using kentico's default searching index.
kentico cms have two date fields(DocumentCreatedWhen,DocumentModifiedWhen) in cms_document table. I am able to find these two fields in view_cms_tree_joined.
I have to add New date field(MajorModificationDate) in cms_document table.
I need to enter this date manually when i will update the documents and will sort the search data according to majormodifieddate.

Could anyone please suggest.

Thanks
Lokendra Jain

User avatar
Kentico Support
Kentico Support
Accepted solutionAccepted solution
kentico_janh - 6/26/2013 1:41:15 AM
   
RE:How to add custom field in cms_document table.
Hello Lokendra,

You need to set the ClassShowAsSystemTable column for the cms.document record in the CMS_Class table to True to show the Document table in the Site Manager -> Development -> System tables section and then you can add your custom field into it.

Best regards,
Jan Hermann

User avatar
Member
Member
Lokendra Jain - 6/26/2013 5:29:16 AM
   
RE:How to add custom field in cms_document table.
Hi Jan Hermann,

Thanks for your quick response.



User avatar
Member
Member
Lokendra Jain - 6/26/2013 7:31:45 AM
   
RE:How to add custom field in cms_document table.
Hi Jan Hermann,

I have another question
I have added new column(mojormodifieddate) to cms_document table, I want to use this column on each document type.
how I can use mojormodifieddate as "publishfrom/publishto" date column shown on each document type creation wizard ?
Could you please suggest me.

Thanks
Lokendra Jain

User avatar
Kentico Support
Kentico Support
kentico_janh - 7/1/2013 6:29:50 AM
   
RE:How to add custom field in cms_document table.
Hello,

You would need to edit the \CMSModules\Content\CMSDesk\Edit\Edit.aspx template and add that text field directly to the markup and your custom logic you can place into the DocumentManager_OnAfterAction method.

Best regards,
Jan Hermann

User avatar
Member
Member
Lokendra Jain - 7/18/2013 5:25:45 AM
   
RE:How to add custom field in cms_document table.
Hello Jan Hermann,

I have added a column "CustomMajorModifiedDate" to cms_document table.
This column is also shown in the view "View_Cms_Tree_Joined". I want to sort the search result according to this column(CustomMajorModifiedDate). Like i can sort the result using "DocumentModifiedWhen" . When sorting with "DocumentModifiedWhen" results show fine. But when I am sorting with "CustomMajorModifiedDate" results are not showing as expected.

Could you please suggest me.

Best Regards
Lokendra Jain

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 7/21/2013 1:53:56 PM
   
RE:How to add custom field in cms_document table.
Hello Lokendra,

and did you try to compare the results from the DB? Isn't the reason that you have added this field later and older records in the DB table has this field empty/NULL? Please take a look at the DB table according to the results you are expecting.

Best Regards,
Martin Danko