Hi team,
I am trying to create a new document print on an Archive sales order, trying to link with the sales order archive header, and Line getting the below error. Pls guide how I can solve this issue
refer the code
================================
report 60120 Salesorderarchive
{
Caption = 'SalesOrder Archive';
UsageCategory = ReportsAndAnalysis;
ApplicationArea = All;
dataset
{
dataitem("Sales H Archive"; "Sales Header Archive")
{
PrintOnlyIfDetail = true;
column(Hno; "Sales H Archive"."No.") { }
column(Hdate; "Sales H Archive"."Order Date") { }
column(Hcustomer; "Sales H Archive"."Sell-to Customer No.") { }
column(HCustname; "Sales H Archive"."Sell-to Customer Name") { }
column(HSPeron; "Sales H Archive"."Salesperson Code") { }
column(HDocType; "Sales H Archive"."Document Type") { }
column(HVersion_No; "Sales H Archive"."Version No.") { }
// column(Sales_Header_Archive_Document_Type; "Document Type")
// column(Sales_Header_Archive_No_; "No."){}
}
// Archive Line item // -- Start
dataitem("Sales Line Archive"; "Sales Line Archive") // "Sales Line Archive"; "Sales Line Archive"
{
DataItemLink = "Document Type" = FIELD("Document Type"), "Document No." = FIELD("No.");
DataItemLinkReference = "Sales Header Archive";
DataItemTableView = SORTING("Document Type", "Document No.", "Line No.");
column(Alineno; "Sales L Archive"."No.") { }
column(ALinedocno; "Sales L Archive"."Document No.") { }
column(AlinedocType; "Sales L Archive"."Document Type") { }
column(Alinedesciption; "Sales L Archive".Description) { }
column(ALineUnitofMeasure; "Sales L Archive"."Unit of Measure") { }
column(Quantity_SalesLine; "Sales L Archive".Quantity) { }
column(ALineUnitPrice; "Sales L Archive"."Unit Price") { }
column(AlLineDiscountAmt; "Sales L Archive"."Line Discount Amount") { }
column(TotalAmount; TotalAmount) { }
column(ALineVATAmount; "Amount Including VAT" - Amount) { }
column(AlineAmount_SalesLine; "Sales L Archive".Amount) { }
column(AllineAmountIncludingVAT_SalesLine; "Sales L Archive"."Amount Including VAT") { }
column(CI; CI) { }
trigger OnAfterGetRecord()
begin
CI += 1;
TotalAmount := (("Sales L Archive"."Unit Price") * ("Sales L Archive".Quantity)) - "Sales L Archive"."Line Discount Amount";
TotalAmount += "Sales L Archive"."Amount Including VAT";
RepCheck.InitTextVariable;
RepCheck.FormatNoText(NoText, TotalAmount, "Sales H Archive"."Currency Code");
AmountInWords := NoText[1];
end;
trigger OnPreDataItem()
begin
TotalAmount := 0;
CI := 0;
end;
} // Sales Line End
}
requestpage
{
layout { }
actions { }
}
// rendering
// {
// layout(LayoutName)
// {
// Type = RDLC;
// LayoutFile = 'mylayout.rdl';
// }
// }
var
myInt: Integer;
AmountInWords: Text;
RepCheck: Report "Check";
TotalAmount: Decimal;
NoText: array[2] of Text;
CI: Integer;
}