Hi,
First of all, the Document attachment field is empty. It does not contain the AttachmentGroupGUID as you might expect. Group attachments are stored in CMS_Attachment table. The only difference between standard attachment and group attachment is that AttachmentGroupGUID column is filled with GUID in case the attachment is group attachments.
Below you can find code example which you need to use to get
AttachmentGroupGUID of your attachment field (The code example is for cms.news document type and field NewsAttachments which is of type “Document attachments”):
using CMS.SettingsProvider;
using CMS.FormEngine;
DataClassInfo dci = DataClassInfoProvider.GetDataClass("cms.news");
if (dci != null)
{
FormInfo fi = new FormInfo(dci.ClassFormDefinition);
FormFieldInfo ffi = fi.GetFormField("NewsAttachments");
Guid AttachmentGroupGUID = ffi.Guid;
}
Best regards,
Michal Legen