Access system fields

Version: 10.4

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:

RequestResponse
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;

Do you have some feedback for us?

If you have suggestions for improving this article,