问题
I'm trying to make a query against the table HcmWorker and related. But i want to figure out how to get the result of the display method HcmWorker.primaryDepartmentName() into it's own field in my query.
I also tried creating a view to execute the function via a ViewMethod but that doesn't seem to work as ViewMethods only inject code into the final query against the view.
I'm NOT making a form. The end result has to come through the QueryService.
回答1:
Sorry, but what you are trying to do is not possible.
You could calculate a non stored field in the postLoad
method, but that would impact every access to your table, and it would most likely not work in the context of a query service.
来源:https://stackoverflow.com/questions/17483438/using-a-table-display-method-in-a-query-or-view