The CRUD methods are the same for any document type (custom or not), you simply specify the "code name" you gave it when you created it. Take a
look at the post here and the
API Examples here. Below is a code sample for retrieving documents:
private bool GetAndUpdateDocuments()
{
// Create an instance of the Tree provider first
TreeProvider tree = new TreeProvider(CMSContext.CurrentUser);
// Fill dataset with documents
DataSet documents = tree.SelectNodes(CMSContext.CurrentSiteName, "/API-Example/%", "en-us", false, "CMS.MenuItem");
if (!DataHelper.DataSourceIsEmpty(documents))
{
// Loop through all documents
foreach (DataRow documentRow in documents.Tables[0].Rows)
{
// Create a new Tree node from the data row
TreeNode editDocument = TreeNode.New(documentRow, "CMS.MenuItem", tree);
string newName = editDocument.DocumentName.ToLower();
// Change coupled data
editDocument.SetValue("MenuItemName", newName);
// Change document data
editDocument.DocumentName = newName;
// Save to database
editDocument.Update();
}
return true;
}
return false;
}