Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8901

Set Kentico primary key value when inserting TreeNode

$
0
0
With Kentico 13, I'm looking for a way to specify the primary key value when inserting a TreeNode via API. Something like:var node = TreeNode.New(@MyPageType@); node.SetValue(@MyPageTypeID@, 1234); node.Insert(parentNode); This needs to set the primary key in the MyPageType table so needs SQL identity insert on, and also needs to set the DocumentForeignKeyValue in the CMS_Document table.The only way I have thought of doing it is with some custom SQL after the node is created, but feels like a hack. Is there a better way?This is for a content migration task of thousands of documents. After the content migration the default SQL @ primary key behavior will be used.

Viewing all articles
Browse latest Browse all 8901

Trending Articles