Hi All,
I want to Hide some fields based on some condition. for example, I have one field type of lookup and in that I have a lookup table, and I am selecting one option from there suppose 'Tangible' so based on Tangible option I want to hide some other fields and show some fields. I tried below code, but it didn't work.
>>Below is screen print for the Lookup field:

>>Here hideshow is variable of type boolean.
// local procedure hideshowfield(): Boolean
// begin
// hideshow := true;
// if Rec."FA Class Code" = 'HOUSE' then begin
// hideshow := false;
// exit(hideshow);
// end else begin
// hideshow := true;
// exit(hideshow);
// end;
// end;

modify("FA Class Code")
{
Caption = 'Asset Type';
trigger OnAfterValidate()
begin
//hideshowfield();
end;
}

field("Description 2"; Rec."Description 2")
{
ApplicationArea = all;
//Visible = hideshow;
}
Can anyone give me a suggestion what is missing here? or any other way to achieve this?
Thank You.