Answer
A custom logical unit's attribute can't reference the view the way ad-hoc SQL Query Tool testing does — reference the underlying table directly instead (prefix with the table alias, not the view alias). Since OBJID typically isn't present on the base table itself, use ROWKEY instead — that means changing both the attribute's Arguments (to the table's ROWKEY) and the WHERE clause condition that compared against OBJID (to compare against ROWKEY instead). Also make sure the Select Statement is trimmed down to return only the single column the attribute actually needs, since a custom attribute's select statement generally can't return multiple columns.