if you're accessing the news item by using CurrentDocument
data, you can simply use CurrentDocument.DocumentForeignKeyValue
which will be the PageNewsId
assuming the current document is of class cms.news
.
The field DocumentForeignKeyValue
on the CMS_Document
record, stores the primary key of the page type record as a reference. It does this because the CMS_Document
table stores the page and language data while the CMS_News
page type table only stores the page types data. There are other references but this is a simple explanation of what is going on.