Hi,
It is perfectly fine to access custom tables by regular SQL, just do it in custom utility class.
The best practice is to use separate static utility class for custom logic and access its methods from any place in WebUI. This will improve code maintainability.
Don't use straight SQL in enhanced controller/context methods.
Regards,
Vladimir