Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Document Attachment Control View modes: 
User avatar
Certified Developer 8
Certified Developer 8
richard - 7/8/2010 11:41:25 PM
   
Document Attachment Control
I have created a document type with a Document Attachment Control

I add a new document to the tree and select multiple attachments using the control in the Form view.

When I try to get the document attachments for the attachment group using the code on this page: http://devnet.kentico.com/Knowledge-Base/API-and-Internals/How-to-get-data-of-document-attachment-using-API.aspx

The GUID is always empty. When I look in the database table of the document type the field that should have the Attachment Group Guid in it is empty.

Is this a BUG or have a missed something.

Please note that if I use the document attachment webpart on the page it works fine.

Cheers

Richard

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/20/2010 4:12:25 AM
   
RE:Document Attachment Control
Hi,


The code from knowledge base works for single attachments but not for multiple attachments (in one document type field). We called the multiple attachments as "Grouped attachments" (http://devnet.kentico.com/docs/devguide/attachments_example_2.htm). The inner structure of single/grouped attachments are different. That is why the code mentioned in your report does not work.

If you need to get the grouped attachments in code you can use Document attachments web part (http://devnet.kentico.com/docs/webparts/KenticoCMS_WebParts.htm#_67155978-183c-46ca-9eed-52d6dd609480) or Attachments data source (http://devnet.kentico.com/docs/webparts/KenticoCMS_WebParts.htm#_73c2ba18-6e65-424e-95c0-2a2fc4bab8f7).

You can register them in your code and use the output.


Best regards,
Helena Grulichova