Hello Scott,
Fields defined as part of a Document Type are not directly accessible from the SKU Info Object. This is due to a fact that SKUs can be used by multiple documents, with different values in this field.
You will need to specify which specific document's field you would like to access, like this:
CMS.DocumentEngine.TreeNode node = TreeHelper.SelectSingleNode("<NodeAliasPath or NodeID>");
if (node != null)
{
string result = ValidationHelper.GetString(node.GetValue("CustomField"), "Invalid string");
}
Or you will need to cycle through all documents which may be, but do not have to be, linked to the SKU. You can find all related documents based on the NodeSKUID. Please note, that you need to specify a single Document Type, otherwise Document Type fileds will not load:
TreeNodeDataSet nodes = TreeHelper.SelectNodes("/Products/%", false, "CMS.Product", "NodeSKUID = 1183");
if (!DataHelper.DataSourceIsEmpty(nodes))
{
foreach (var row in nodes)
{
string value = ValidationHelper.GetString(row.GetValue("CustomField"), "Invalid string");
}
}
Let me know if you need any further help.
Regards,
Josef