I want to add attahcment to the posted sales shipment card, I used 2 tables "Document Attachment", and "Attahcment Entity Buffer", but no success.
Can someone guide me or have a step by step tutorial link you can send me,.
Here are the apis i created :
page 50818 "Document Attachment DetailsAPI"
{
PageType = API;
APIVersion = 'v1.0';
APIPublisher = 'bctech';
APIGroup = 'demo';
EntityCaption = 'documentAttachmentDetailsAPI';
EntitySetCaption = 'documentAttachmentDetailsAPI';
EntityName = 'documentAttachmentDetailsAPI';
EntitySetName = 'documentAttachmentDetailsAPI';
SourceTable = "Document Attachment";
Extensible = false;
DelayedInsert = true;
InsertAllowed = true;
layout
{
area(Content)
{
repeater(General)
{
field(documentType; Rec."Document Type")
{
Caption = 'Document Type';
}
field(fileName; Rec."File Name")
{
Caption = 'Attachment';
}
field(fileType; Rec."File Type")
{
Caption = 'File Type';
}
field(documentReferenceID; Rec."Document Reference ID")
{
Caption = 'Document Reference ID';
}
field(attachedDate; Rec."Attached Date")
{
Caption = 'Attached Date';
}
field(id; Rec.ID)
{
Caption = 'ID';
}
field(lineNo; Rec."Line No.")
{
Caption = 'Line No.';
}
field(no; Rec."No.")
{
Caption = 'No.';
}
field(fileExtension; Rec."File Extension")
{
Caption = 'File Extension';
}
field(tableID; Rec."Table ID")
{
Caption = 'Table ID';
}
}
}
}
}
page 50831 AttachmentBuffer
{
APIGroup = 'demo';
APIPublisher = 'bctech';
APIVersion = 'v1.0';
ApplicationArea = All;
Caption = 'attachmentBuffer';
DelayedInsert = true;
EntityName = 'AttachmentBuffer';
EntitySetName = 'AttachmentBuffer';
PageType = API;
SourceTable = "Attachment Entity Buffer";
InsertAllowed = true;
ModifyAllowed = true;
layout
{
area(Content)
{
repeater(General)
{
field(id; Rec.Id)
{
Caption = 'Id';
}
field(fileName; Rec."File Name")
{
Caption = 'File Name';
}
field("type"; Rec."Type")
{
Caption = 'Type';
}
field(attachmentContent; Rec.Content)
{
Caption = 'Content';
}
field(documentType; Rec."Document Type")
{
Caption = 'Document Type';
}
field(parentType; Rec."Attachment Type")
{
Caption = 'Attachment Type';
}
field(parentId; Rec."Document Id")
{
Caption = 'Document Id';
ShowMandatory = true;
trigger OnValidate()
begin
end;
}
field(lineNo; Rec."Line No.")
{
Caption = 'Line No.';
}
field(systemId; Rec.SystemId)
{
Caption = 'SystemId';
}
}
}
}
}