Embeded and Reference mode of attachments in one application

I GetA12 Login there is described two basic modes of usage of attachments. The Embedded mode and the reference mode.

Is it possible to combine these modes in one application?

For example in documents of one document model to use embedded mode and in documents of other document model to use reference mode?

As far as data services team told me it is possible.
You can use embedded and reference mode in parallel. What you cannot do in parallel is run reference mode in DB and FS.
See A12 Data Services: Attachment properties for application props.

The reply of @markus-agile-fog is correct. I would like to point out that this is DS perspective on attachments because embedded attachments are not interpreted in DS in any way. There is no difference between document and document with embedded attachments from the DS point of view. There are no extra extension points nor any extra code that is being executed for the document with embedded attachments.

AFAIK the difference between embedded attachments and the reference mode attachments is being defined by the client when the particular attachment handler is being configured. I do not know how the attachment handler is configured by the client. Is there one instance per document model? or is it one instance per application? I will ask Chris Rebbelin to shed a bit of light on this aspect of mixing the reference and embedded attachments.

This answer is valid for Data services in version 30.1 - 34.2.0

Hi, mixing attachment handlers is possible in the frontend. This is because the client only configures an attachment handler and passes it to the form engine (at some point), which then calls it.

This means you could create/configure multiple attachment handlers in client and decide on your own (e.g. based on the currently used document model) which one you want to pass to your FormEngine component, e.g.:

function CustomFormEngine(props: FormEngineViews.FormEngineProps): JSX.Element {

    const myCondition = /* decide which mode to use here */	

    const attachmentHandler = myCondition ? referenceHandler : embeddedHandler;
    return <CRUDViews.FormEngineView {...props} attachmentHandler={attachmentHandler} />;
}