Abweichende Verwendung der SQUEEZE Anhänge
Im Folgenden wird kurz erläutert, wie die durch SQUEEZE for BC heruntergeladenen Anhänge für ein Szenario verwendet werden können, das von der vorgesehenen Verwendung abweicht.
// Set IsHandled to true and implement your code
// Do not forget to deactivate "Transfer attachments to target document" in the Document Class Setup
[EventSubscriber(ObjectType::Codeunit, Codeunit::"DXP Document Mgt.", 'OnBeforeTransferCoreAttachmentsToStandardDocument', '', false, false)]
local procedure DXPDocMgtOnBeforeTransferCoreAttachmentsToStandardDocument(Document: Record "DXP Document"; var IsHandled: Boolean)
begin
IsHandled := true;
HandleCoreAttachmentsAccordingToYourNeeds(Document, IsHandled);
end;
procedure HandleCoreAttachmentsAccordingToYourNeeds(Document: Record "DXP Document"; var IsHandled: Boolean)
var
CoreAttachments: Record "DXP Document Attachment";
InStr: InStream;
begin
CoreAttachments.SetRange("Document No.", Document."No.");
CoreAttachments.IsEmpty() then
exit;
CoreAttachments.FindSet();
repeat
CoreAttachments.Calcfields(Attachment);
CoreAttachments.Attachment.CreateInStream(InStr);
// Here you can handle the file stream according to your needs
[...]
until CoreAttachments.Next() = 0;
end;