is there a way i could avoid using "object"?
I made this method, where i had to make the return type as object, as class AA extends class AAExtra
public static Object getValue(Field1 _field1, Field2 _field2, Id _Id, NoYesId _more = NoYes::No)
{
Object value;
Table1 table1;
Table2 table2;
Table3 table3;
select table1.......etc with joins
if(table1)
{
if(_more)
{
value = AAExtra();
value.zz(table1.FieldZ);
}
else
{
value = new AA();
}
value.Field1(table3.Field1);
value.Field2(table1.Field2);
value.TypeId(table3.Type);
value.Format(table3.Format);
}
return value;
}
Then when calling the method, i had also to use "object" -- is this a good approach?
List list = new List(Types::Class);
while select Field1, Field2, Field3 from randomTable
group by Field1, Field2, Field3
where randomTable.Id == _header.Id
&& randomTable.Field1 != ''
{
Object value = TableX::getValue(randomTable.Field1,randomTable.Field2, _Id);
if(value)
{
list.addEnd(value);
}
}
}