bufdbfunc

no buffer defined for table in function

rule "bufdbfunc" requires that DEFINE BUFFER statements exist for every database buffer that appears in the code for a user-defined function.

Example:

FUNCTION SomethingStupid RETURNS LOGICAL :
    IF customer.cust-name = "jurjen" THEN 
       customer.cust-name = "john".
    RETURN FALSE.
END FUNCTION.

should have its own local buffer, like for example

FUNCTION SomethingStupid RETURNS LOGICAL :
    DEFINE BUFFER customer FOR customer.
    IF customer.cust-name = "jurjen" THEN 
       customer.cust-name = "john".
    RETURN FALSE.
END FUNCTION.

That way, you prevent side-effects from changing a buffer that may also be used by other internal proedures or functions. You also prevent locking issues, which are likely to happen when the procedure runs persistent.