-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPostedSalesInvoiceExt.tableext.al
More file actions
71 lines (66 loc) · 2.4 KB
/
PostedSalesInvoiceExt.tableext.al
File metadata and controls
71 lines (66 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
pageextension 50100 SD_PostedSalesInvExt extends "Posted Sales Invoice"
{
actions
{
addafter(Email)
{
action(OpenInOneDrive)
{
ApplicationArea = Basic, Suite;
Caption = 'Open in OneDrive';
Image = Cloud;
Enabled = ShareOptionsEnabled;
Promoted = true;
PromotedOnly = true;
PromotedCategory = Category6;
PromotedIsBig = true;
trigger OnAction()
var
TempBlob: Codeunit "Temp Blob";
DocumentServiceManagement: Codeunit "Document Service Management";
InStr: InStream;
begin
GetInvoicePDF(TempBlob);
TempBlob.CreateInStream(InStr);
DocumentServiceManagement.OpenInOneDrive(StrSubstNo(SalesInvoiceName, Rec."No."), '.pdf', InStr);
//For attachments:
//DocumentServiceManagement.OpenInOneDriveFromMedia(SalesInvoiceName,'.pdf',"Document Reference ID".MediaId());
end;
}
action(BlobStorageDemo)
{
ApplicationArea = All;
Caption = 'Blob Storage Demo';
Promoted = true;
PromotedOnly = true;
PromotedCategory = Category6;
PromotedIsBig = true;
Image = FiledOverview;
trigger OnAction()
var
BlobStorageMgt: Codeunit BlobStorageManagement;
begin
BlobStorageMgt.Run()
end;
}
}
}
var
ShareOptionsEnabled: Boolean;
SalesInvoiceName: Label 'Sales Invoice %1';
trigger OnOpenPage()
var
DocumentSharing: Codeunit "Document Sharing";
begin
ShareOptionsEnabled := DocumentSharing.ShareEnabled();
end;
local procedure GetInvoicePDF(var TempBlob: Codeunit "Temp Blob")
var
ReportSelections: Record "Report Selections";
RecRef: RecordRef;
begin
RecRef.GetTable(Rec);
RecRef.SetRecFilter();
ReportSelections.GetPdfReportForCust(TempBlob, ReportSelections.Usage::"S.Invoice", RecRef, Rec.GetSellToCustomerFaxNo());
end;
}