Hi All,
I created a simple table extension and page extension in sales header to lookup a new drop down field in customer record. However i have two issues:
1. On sales Order look list shows list of customers rather than the values from the new field in customer (maybe this should be a ENUM)
2.Once a customer is slected it shows the internal key (0,1,2 etc) that corresponds to front end values such as A,B,C. I need to show A, B,C instead of 1,2,3
Idea is to auto fill a field on sales header based on the same field on customer card which i thought is a simple requirement
Heres the simple sample code:
tableextension 50141 Size extends Customer
{
fields
{
field(50141; Size; option)
{
DataClassification = ToBeClassified;
OptionMembers = "Select One",A,B,C;
}
}
}
pageextension 50131 Size extends "Customer Card"
{
layout
{
addlast(General)
{
field(Size; Size)
{
ApplicationArea = All;
Caption = 'Size';
}
}
}
}
tableextension 50132 SalesOrderHeader extends "Sales Header"
{
fields
{
field(50133; Size; Text[20])
{
DataClassification = ToBeClassified;
TableRelation = Customer.Size;
ValidateTableRelation = false;
trigger OnValidate()
var
CustomerRec: Record Customer;
begin
CustomerRec.Reset();
CustomerRec.SetFilter(Size, Rec.Size);
if CustomerRec.Count < 1 then
Error('Size contains a value "%1" that cannot be found in the related table "customer"', Rec.Size);
end;
}
}
}
pageextension 50132 SalesOrderHeader extends "Sales Order"
{
layout
{
addlast(General)
{
field(Size; Size)
{
ApplicationArea = All;
//TableRelation = "Sales Header".Size;
Caption = 'Size';
}
}
}
}