1. Access field values

Access system fields

Version:

You can use the Sitecore.FieldIDs class to access system fields. For example, to access the archive date field of the /Sitecore/Content/Home/Sample item in the Master database:

Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");

Sitecore.Data.Items.Item sample = master.GetItem("/sitecore/content/home/sample");

Sitecore.Data.Fields.DateField archiveField =

sample.Fields[Sitecore.FieldIDs.ArchiveDate];

DateTime archiveWhen = archiveField.DateTime;
If you have suggestions for improving this article, let us know!