flowfield calcformula with variables

Hello 
I was wondering. I have 3 fields in a table
field(1; Code; Code[20])
{
Caption = 'Code';
DataClassification = ToBeClassified;
TableRelation =
if ("Status Object" = const(Customer)) Customer
else
if ("Status Object" = const(Item)) Item
else
if ("Status Object" = const(Vendor)) Vendor;
}
field(2; "Status Object"; Enum "Status object")
{
Caption = 'Status Object';
DataClassification = ToBeClassified;
}
field(3; Description; Text[50])
{
Caption = 'Description';
DataClassification = ToBeClassified;
}
Now I want the field description to show me the name or description of the object ( vendor, item or customer ) that is in field 1 (code). I would normally do this with a flowfield and calcformula = lookup ... where ... but I can't implement an if statement here.
Thanks for the help
Related
Recommended