Here I have field sales order archive where I have used table relation for getting orders, but I wanted to only show the posted sales order details in my field how can be done?
page 50418 EnquiryFilter
{
Caption = 'EnquiryFilter';
PageType = XmlPort;
UsageCategory = Administration;
ApplicationArea = all;
layout
{
area(content)
{
group(General)
{
field(SalesNo; SalesNo)
{
ApplicationArea = All;
TableRelation = "Sales Header"."No.";
Caption = 'Sales Order No.';
Editable = true;
trigger OnValidate()
begin
if (Rec.ExternalDocNo <> '') Or (Rec.shipToCode <> '') or (Rec.BillPostCode <> '') or (Rec.SalesOrderNo <> '') then begin
Rec.SalesOrderNo := SalesNo;
Rec.Modify();
end
else begin
Rec.Init();
Rec.No := CreateGuid();
Rec.SalesOrderNo := SalesNo;
Rec.Insert();
end;
end;
}
field(SalesArchiveNo; SalesArchiveNo)
{
ApplicationArea = All;
TableRelation = "Sales Header Archive"."No.";
Caption = 'Sales Archive Order No.';
Editable = true;
trigger OnValidate()
begin
if ((Rec.ExternalDocNo <> '') Or (Rec.shipToCode <> '') or (Rec.BillPostCode <> '') or (Rec.SalesOrderArchive <> '')) and (Rec.SalesOrderNo = '') then begin
Rec.SalesOrderArchive := SalesArchiveNo;
Rec.Modify();
end
else begin
Rec.Init();
Rec.No := CreateGuid();
Rec.SalesOrderArchive := SalesArchiveNo;
Rec.Insert();
end;
end;
}
}
}
}
var
SalesNo: Code[20];
SalesArchiveNo: Code[20];
ExternalDOCNo: Code[35];
PostCode: Code[50];
shipToCode: Code[50]
;
Archive: Boolean;
Rec: Record EnquiryFilter;
}
Sorry, I am getting Boolean error.
Hi,
you can use this field when look up archive table
Hi where to use this field in my code , ,where I used sales archive field?
Little confused on how to use it?
Hi,
For Posted Archives records you can use below fields from Sales header Archive table.
Yes I can but, can I filter Sales header archive table by showing only posted sales order in my field.
As I code according to sales archive order so?
The posted invoices are stored in the "Sales Invoice Header" table. So use this table in the TableRelation instead of the "Sales Header" table.
As far as I know, there are no archived posted invoices.
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,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156