2
It would be great and very helpful if similar to .NET reflection feature is added to Business Central.
The idea is to have a way to dynamically enumerate and call procedures from different objects - codeunits, tables etc. similarly to the way how RecordRef gives reflection on database level and allow dynamically access table data.
This is a sample pseudo-code for the above feature:
procedure ReflectionDemo()
var
CURef:CodeunitRef;
SalesHeader:Record "Sales Header";
begin
CURef.open(Codeunit::"Sales Post");
if CURef.ProcedureExists('CalcInvDiscount') then
if SalesHeader.FindFindFirst() then
CURef.Execure('CalcInvDiscount', SalesHeader);
end;
STATUS DETAILS
New