Page 6660 Posted Return Receipt, source in 29
Source29
src/Layers/W1/BaseApp/Sales/History/PostedReturnReceipt.Page.al736 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Sales.History;
using Microsoft.CRM.Contact;
using Microsoft.Finance.Dimension;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Attachment;
using Microsoft.Sales.Comment;
using System.Automation;
/// <summary>
/// Displays a single posted sales return receipt document with header and line details.
/// </summary>
page 6660 "Posted Return Receipt"
{
Caption = 'Posted Return Receipt';
InsertAllowed = false;
PageType = Document;
RefreshOnActivate = true;
SourceTable = "Return Receipt Header";
layout
{
area(content)
{
group(General)
{
Caption = 'General';
field("No."; Rec."No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("Sell-to Customer No."; Rec."Sell-to Customer No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("VAT Registration No."; Rec."VAT Registration No.")
{
ApplicationArea = VAT;
Editable = false;
Importance = Additional;
Visible = false;
}
field("Sell-to Contact No."; Rec."Sell-to Contact No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
group("Sell-to")
{
Caption = 'Sell-to';
field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name';
Editable = false;
}
field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name 2';
Editable = false;
Visible = false;
}
field("Sell-to Address"; Rec."Sell-to Address")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address';
Editable = false;
}
field("Sell-to Address 2"; Rec."Sell-to Address 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address 2';
Editable = false;
}
field("Sell-to City"; Rec."Sell-to City")
{
ApplicationArea = SalesReturnOrder;
Caption = 'City';
Editable = false;
}
group(Control19)
{
ShowCaption = false;
Visible = IsSellToCountyVisible;
field("Sell-to County"; Rec."Sell-to County")
{
ApplicationArea = SalesReturnOrder;
CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
Editable = false;
}
}
field("Sell-to Post Code"; Rec."Sell-to Post Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Post Code';
Editable = false;
}
field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Country/Region';
Editable = false;
}
field("Sell-to Contact"; Rec."Sell-to Contact")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Contact';
Editable = false;
}
field(SellToPhoneNo; SellToContact."Phone No.")
{
ApplicationArea = Basic, Suite;
Caption = 'Phone No.';
Importance = Additional;
Editable = false;
ExtendedDatatype = PhoneNo;
ToolTip = 'Specifies the telephone number of the contact person at the customer''s main address.';
}
field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
{
ApplicationArea = Basic, Suite;
Caption = 'Mobile Phone No.';
Importance = Additional;
Editable = false;
ExtendedDatatype = PhoneNo;
ToolTip = 'Specifies the mobile telephone number of the contact person at the customer''s main address.';
}
field(SellToEmail; SellToContact."E-Mail")
{
ApplicationArea = Basic, Suite;
Caption = 'Email';
Importance = Additional;
Editable = false;
ExtendedDatatype = EMail;
ToolTip = 'Specifies the email address of the contact person at the customer''s main address.';
}
}
field("Posting Date"; Rec."Posting Date")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("Document Date"; Rec."Document Date")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
field("Return Order No."; Rec."Return Order No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("External Document No."; Rec."External Document No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("Salesperson Code"; Rec."Salesperson Code")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
field("Responsibility Center"; Rec."Responsibility Center")
{
ApplicationArea = Suite;
Editable = false;
}
field("No. Printed"; Rec."No. Printed")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
}
part(ReturnRcptLines; "Posted Return Receipt Subform")
{
ApplicationArea = SalesReturnOrder;
SubPageLink = "Document No." = field("No.");
}
group(Invoicing)
{
Caption = 'Invoicing';
field("Bill-to Customer No."; Rec."Bill-to Customer No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
field("Bill-to Contact No."; Rec."Bill-to Contact No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
group("Bill-to")
{
Caption = 'Bill-to';
field("Bill-to Name"; Rec."Bill-to Name")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name';
Editable = false;
}
field("Bill-to Name 2"; Rec."Bill-to Name 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name 2';
Editable = false;
Importance = Additional;
Visible = false;
}
field("Bill-to Address"; Rec."Bill-to Address")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address';
Editable = false;
}
field("Bill-to Address 2"; Rec."Bill-to Address 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address 2';
Editable = false;
}
field("Bill-to City"; Rec."Bill-to City")
{
ApplicationArea = SalesReturnOrder;
Caption = 'City';
Editable = false;
}
group(Control29)
{
ShowCaption = false;
Visible = IsBillToCountyVisible;
field("Bill-to County"; Rec."Bill-to County")
{
ApplicationArea = SalesReturnOrder;
CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
Editable = false;
}
}
field("Bill-to Post Code"; Rec."Bill-to Post Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Post Code';
Editable = false;
}
field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Country/Region';
Editable = false;
}
field("Bill-to Contact"; Rec."Bill-to Contact")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Contact';
Editable = false;
}
field(BillToContactPhoneNo; BillToContact."Phone No.")
{
ApplicationArea = Basic, Suite;
Caption = 'Phone No.';
Editable = false;
Importance = Additional;
ExtendedDatatype = PhoneNo;
ToolTip = 'Specifies the telephone number of the contact person at the customer''s billing address.';
}
field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
{
ApplicationArea = Basic, Suite;
Caption = 'Mobile Phone No.';
Editable = false;
Importance = Additional;
ExtendedDatatype = PhoneNo;
ToolTip = 'Specifies the mobile telephone number of the contact person at the customer''s billing address.';
}
field(BillToContactEmail; BillToContact."E-Mail")
{
ApplicationArea = Basic, Suite;
Caption = 'Email';
Editable = false;
Importance = Additional;
ExtendedDatatype = EMail;
ToolTip = 'Specifies the email address of the contact person at the customer''s billing address.';
}
}
field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
{
ApplicationArea = Dimensions;
Editable = false;
}
field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
{
ApplicationArea = Dimensions;
Editable = false;
}
}
group(Shipping)
{
Caption = 'Shipping';
field("Ship-to Code"; Rec."Ship-to Code")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
}
group("Ship-to")
{
Caption = 'Ship-to';
field("Ship-to Name"; Rec."Ship-to Name")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name';
Editable = false;
}
field("Ship-to Name 2"; Rec."Ship-to Name 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Name 2';
Editable = false;
Importance = Additional;
Visible = false;
}
field("Ship-to Address"; Rec."Ship-to Address")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address';
Editable = false;
}
field("Ship-to Address 2"; Rec."Ship-to Address 2")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Address 2';
Editable = false;
}
field("Ship-to City"; Rec."Ship-to City")
{
ApplicationArea = SalesReturnOrder;
Caption = 'City';
Editable = false;
}
group(Control37)
{
ShowCaption = false;
Visible = IsShipToCountyVisible;
field("Ship-to County"; Rec."Ship-to County")
{
ApplicationArea = SalesReturnOrder;
CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
Editable = false;
}
}
field("Ship-to Post Code"; Rec."Ship-to Post Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Post Code';
Editable = false;
}
field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Country/Region';
Editable = false;
}
field("Ship-to Phone No."; Rec."Ship-to Phone No.")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Phone No.';
Editable = false;
}
field("Ship-to Contact"; Rec."Ship-to Contact")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Contact';
Editable = false;
}
}
field("Location Code"; Rec."Location Code")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
group("Shipment Method")
{
Caption = 'Shipment Method';
field("Shipment Method Code"; Rec."Shipment Method Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Code';
Editable = false;
ToolTip = 'Specifies the reason for the posted return.';
}
field("Shipping Agent Code"; Rec."Shipping Agent Code")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Agent';
Editable = false;
Importance = Additional;
}
field("Package Tracking No."; Rec."Package Tracking No.")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Additional;
}
}
field("Shipment Date"; Rec."Shipment Date")
{
ApplicationArea = SalesReturnOrder;
Editable = false;
Importance = Promoted;
}
}
}
area(factboxes)
{
systempart(Control1900383207; Links)
{
ApplicationArea = RecordLinks;
Visible = false;
}
systempart(Control1905767507; Notes)
{
ApplicationArea = Notes;
Visible = true;
}
part("Attached Documents List"; "Doc. Attachment List Factbox")
{
ApplicationArea = All;
Caption = 'Documents';
UpdatePropagation = Both;
SubPageLink = "Table ID" = const(Database::"Return Receipt Header"),
"No." = field("No.");
}
}
}
actions
{
area(navigation)
{
group("&Return Rcpt.")
{
Caption = '&Return Rcpt.';
Image = Receipt;
action(Statistics)
{
ApplicationArea = SalesReturnOrder;
Caption = 'Statistics';
Image = Statistics;
RunObject = Page "Return Receipt Statistics";
RunPageLink = "No." = field("No.");
ShortCutKey = 'F7';
ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
}
action("Co&mments")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Co&mments';
Image = ViewComments;
RunObject = Page "Sales Comment Sheet";
RunPageLink = "Document Type" = const("Posted Return Receipt"),
"No." = field("No."),
"Document Line No." = const(0);
ToolTip = 'View or add comments for the record.';
}
action(Dimensions)
{
AccessByPermission = TableData Dimension = R;
ApplicationArea = Dimensions;
Caption = 'Dimensions';
Image = Dimensions;
ShortCutKey = 'Alt+D';
ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
trigger OnAction()
begin
Rec.ShowDimensions();
end;
}
action(Approvals)
{
AccessByPermission = TableData "Posted Approval Entry" = R;
ApplicationArea = SalesReturnOrder;
Caption = 'Approvals';
Image = Approvals;
ToolTip = 'View a list of the records that are waiting to be approved. For example, you can see who requested the record to be approved, when it was sent, and when it is due to be approved.';
trigger OnAction()
var
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
begin
ApprovalsMgmt.ShowPostedApprovalEntries(Rec.RecordId);
end;
}
}
group("&Line")
{
Caption = '&Line';
Image = Line;
action(DocumentLineTracking)
{
ApplicationArea = SalesReturnOrder;
Caption = 'Document &Line Tracking';
Image = Navigate;
ToolTip = 'View related open, posted, or archived documents or document lines.';
trigger OnAction()
begin
CurrPage.ReturnRcptLines.PAGE.ShowDocumentLineTracking();
end;
}
}
}
area(processing)
{
group("F&unctions")
{
Caption = 'F&unctions';
Image = "Action";
action("&Track Package")
{
ApplicationArea = Basic, Suite;
Caption = '&Track Package';
Image = ItemTracking;
ToolTip = 'Open the shipping agent''s tracking page to track the package. ';
trigger OnAction()
begin
Rec.StartTrackingSite();
end;
}
}
action(SendCustom)
{
ApplicationArea = Basic, Suite;
Caption = 'Send';
Ellipsis = true;
Image = SendToMultiple;
ToolTip = 'Prepare to send the document according to the customer''s sending profile, such as attached to an email. The Send document to window opens first so you can confirm or select a sending profile.';
trigger OnAction()
var
ReturnReceiptHeader: Record "Return Receipt Header";
begin
ReturnReceiptHeader := Rec;
CurrPage.SetSelectionFilter(ReturnReceiptHeader);
ReturnReceiptHeader.SendRecords();
end;
}
action("&Print")
{
ApplicationArea = SalesReturnOrder;
Caption = '&Print';
Ellipsis = true;
Image = Print;
ToolTip = 'Prepare to print the document. A report request window for the document opens where you can specify what to include on the print-out.';
trigger OnAction()
begin
ReturnRcptHeader := Rec;
OnBeforePrintRecords(Rec, ReturnRcptHeader);
CurrPage.SetSelectionFilter(ReturnRcptHeader);
ReturnRcptHeader.PrintRecords(true);
end;
}
action(Email)
{
ApplicationArea = Basic, Suite;
Caption = '&Email';
Image = Email;
ToolTip = 'Prepare to email the document. The Send Email window opens prefilled with the customer''s email address so you can add or edit information.';
trigger OnAction()
begin
ReturnRcptHeader := Rec;
CurrPage.SetSelectionFilter(ReturnRcptHeader);
ReturnRcptHeader.EmailRecords(true);
end;
}
action(AttachAsPDF)
{
ApplicationArea = Basic, Suite;
Caption = 'Attach as PDF';
Image = PrintAttachment;
ToolTip = 'Create a PDF file and attach it to the document.';
trigger OnAction()
var
ReturnReceiptHeader: Record "Return Receipt Header";
begin
ReturnReceiptHeader := Rec;
ReturnReceiptHeader.SetRecFilter();
Rec.PrintToDocumentAttachment(ReturnReceiptHeader);
end;
}
action("&Navigate")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Find entries...';
Image = Navigate;
ShortCutKey = 'Ctrl+Alt+Q';
ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
trigger OnAction()
begin
Rec.Navigate();
end;
}
action("Update Document")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Update Document';
Image = Edit;
ToolTip = 'Add new information that is relevant to the document, such as information from the shipping agent. You can only edit a few fields because the document has already been posted.';
trigger OnAction()
var
PostedReturnReceiptUpdate: Page "Posted Return Receipt - Update";
begin
PostedReturnReceiptUpdate.LookupMode := true;
PostedReturnReceiptUpdate.SetRec(Rec);
PostedReturnReceiptUpdate.RunModal();
end;
}
}
area(Promoted)
{
group(Category_Process)
{
Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
actionref("&Print_Promoted"; "&Print")
{
}
actionref("&Navigate_Promoted"; "&Navigate")
{
}
actionref("Update Document_Promoted"; "Update Document")
{
}
actionref("&Track Package_Promoted"; "&Track Package")
{
}
}
group(Category_Category4)
{
Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 3.';
}
group(Category_Category5)
{
Caption = 'Receipt', Comment = 'Generated from the PromotedActionCategories property index 4.';
actionref(Dimensions_Promoted; Dimensions)
{
}
actionref(Statistics_Promoted; Statistics)
{
}
actionref("Co&mments_Promoted"; "Co&mments")
{
}
actionref(Approvals_Promoted; Approvals)
{
}
}
group(Category_Category6)
{
Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 5.';
actionref(Print_Promoted; "&Print")
{
}
actionref(Email_Promoted; Email)
{
}
actionref(AttachAsPDF_Promoted; AttachAsPDF)
{
}
actionref(SendCustom_Promoted; SendCustom)
{
}
}
group(Category_Report)
{
Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
}
}
}
trigger OnOpenPage()
begin
Rec.SetSecurityFilterOnRespCenter();
ActivateFields();
end;
trigger OnAfterGetRecord()
begin
SellToContact.GetOrClear(Rec."Sell-to Contact No.");
BillToContact.GetOrClear(Rec."Bill-to Contact No.");
end;
var
ReturnRcptHeader: Record "Return Receipt Header";
SellToContact: Record Contact;
BillToContact: Record Contact;
FormatAddress: Codeunit "Format Address";
IsBillToCountyVisible: Boolean;
IsSellToCountyVisible: Boolean;
IsShipToCountyVisible: Boolean;
local procedure ActivateFields()
begin
IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
end;
[IntegrationEvent(false, false)]
local procedure OnBeforePrintRecords(ReturnReceiptHeaderRec: Record "Return Receipt Header"; var ReturnReceiptHeaderToPrint: Record "Return Receipt Header")
begin
end;
}