tableextension 80003 PurchaseHeaderExt extends "Purchase Header"
{
fields
{
field(50100; PurchInvoiceImage; Media)
{
Caption = 'Purchase Invoice Picture';
}
}
}
pageextension 80003 PurchaseInvoiceExt extends "Purchase Invoice"
{
layout
{
addbefore(IncomingDocAttachFactBox)
{
part(PurchaseInvoicePicture; PurchaseInvoicePicture)
{
ApplicationArea = All;
SubPageLink = "Document Type" = field("Document Type"),
"No." = field("No.");
}
}
}
}
page 80003 PurchaseInvoicePicture
{
Caption = 'Purchase Invoice Picture';
PageType = CardPart;
DeleteAllowed = false;
InsertAllowed = false;
LinksAllowed = false;
UsageCategory = Administration;
SourceTable = "Purchase Header";
layout
{
area(Content)
{
field(PurchInvoiceImage; Rec.PurchInvoiceImage)
{
ApplicationArea = All;
ShowCaption = false;
ToolTip = 'Specifies the picture of the purchase invoice.';
}
}
}
actions
{
area(processing)
{
action(TakePicture)
{
ApplicationArea = Basic, Suite;
Caption = 'Take';
Image = Camera;
ToolTip = 'Activate the camera on the device.';
trigger OnAction()
begin
Rec.TestField(Rec."No.");
Camera.AddPicture(Rec, Rec.FieldNo(PurchInvoiceImage));
end;
}
action(DeletePicture)
{
ApplicationArea = Basic, Suite;
Caption = 'Delete';
Enabled = DeleteExportEnabled;
Image = Delete;
ToolTip = 'Delete the record.';
trigger OnAction()
begin
Rec.TestField(Rec."No.");
if not Confirm(DeleteImageQst) then
exit;
Clear(Rec.PurchInvoiceImage);
Rec.Modify(true);
end;
}
}
}
trigger OnAfterGetCurrRecord()
begin
SetEditableOnPictureActions;
end;
var
Camera: Codeunit Camera;
DeleteImageQst: Label 'Are you sure you want to delete the picture?';
DeleteExportEnabled: Boolean;
local procedure SetEditableOnPictureActions()
begin
DeleteExportEnabled := Rec.PurchInvoiceImage.HasValue;
end;
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156