Greetings,
I would like to take an input from the user which is a year and i want the max accepted value to be taken from the general ledger setup table.
I added the maximum integer field in the general ledger table field:
field(50102; MaxYearForCommissions; Integer)
{
Caption = 'Max Year For Commissions';
DataClassification = ToBeClassified;
}
and then proceeded by creating a field in the standard dialogue page where i want this integer to be added:
field(SelectedYear; SelectedYear)
{
ApplicationArea = All;
Caption = 'SelectedYear';
//add max value here
}
Things I tried:
GenLedgSetup: Record "General Ledger Setup";
MinimumValue: integer;
MaximumValue: integer;
trigger OnOpenPage()
begin
System.Clear(SelectedYear);
// MaximumValue := GenLedgSetup.MaxYearForCommissions; (BC is crashing when running this code)
end;