Hi,
I have following use case: I have created a business entity for purchase invoices that fetches invoices and lines from the database. Now I need to add filtering that when users browse (fetch) purchase invoices they must only see the invoices they are allowed to. Rules that apply are rather complicated and
cannot be written directly to dataset/datasource query.
So in non-business entity world we could just write:
FUNCTION CanView RETURNS LOGICAL (INPUT iPmtNum AS INTEGER):
// do some complicated validation from several tables and temp table, uses CAN-FIND statements etc.
RETURN xCanView.
END FUNCTION.
FOR EACH Payment NO-LOCK WHERE ...:
IF NOT CanView(Payment.PmtNum) THEN NEXT.
CREATE ttPayment.
....
END.
Question: Is there a way to implement this to Business Entity (data access level) or is the only way to implement business task for that?
Regards,
Toni