Edit CMS_Class Table.ClassDefaultPageTemplateID via Sql

SOS Childrensvillages asked on October 3, 2017 16:38


I've successfully updated the CMS_Class table with something like this:

update [CMS_Class]
set [ClassDefaultPageTemplateID] = n 
where ClassName in ('foo','bar', 'etc')

However,when I go to the CMS Desk, the update has not been applied. Is there another related table that needs updating?

Thanks in advance

Correct Answer

Matt Nield answered on October 3, 2017 16:51

You probably need to reset the cache to get Kentico to pick up the changes. Open the System application and client the Clear cache button.

See here for more info:

Out of interest, why are you updateing the CMS_Class table manually?

1 votesVote for this answer Unmark Correct answer

Recent Answers

Brenden Kehren answered on October 3, 2017 16:58

If you have workflow enabled, this process will not work because you need to update the most recent version of workflow. If you're only updating 3 classes, I'd suggest just updating those 3 specific page types manually.

Now if you want to update the page template for a specific page, again, if you have workflow enabled, it will not work without updating the workflow process. What I'd suggest in this case is creating some C# and use the API to perform the one time update.

1 votesVote for this answer Mark as a Correct answer

SOS Childrensvillages answered on October 3, 2017 17:00

Thanks Matt. I want to do it with a sql statement as I'll be updating about 10-20 pages across about 18 instances. Best Regards

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.