How to fetch the value of seen_by on my web page?
SELECT
name,
employee,
employee_name,
status,
request_type,
transaction_date,
workflow_state,
DATE_FORMAT(modified, ‘%%Y-%%m-%%d %%H:%%i:%%s’) as formatted_modified_time,
reports_to
FROM tabAsset Request
WHERE employee = %s
ORDER BY STR_TO_DATE(transaction_date, ‘%%d-%%m-%%Y %%H:%%i:%%s’) DESC;“”",
what should I add here for fetch value from backend?
Thanks and Regards
Shubham
ankush
2
- “Track views” stores all views in “View Log” doctype.
- “Track Seen” just stores who saw the current version of document in
_seen
column. It’s a JSON array of usernames.
Both of these only work on Desk i.e. /app/doctype/name
pages. If you’re building custom pages you need create log manually for each view.
I already have tried to fetch the value from “seen” filed, but it’s throwing error
@ankush
ankush
4
It’s _seen
not seen
and it’s only present if you’ve enabled “Track Seen”.
Mostly you’re looking for View Log
which doesn’t reset after document is updated.
yes, I have tried both, seen/_seen, error throwing not defined, and I already have enabled.
error : {{ undefined value printed: access to attribute ‘_seen’ of ‘_dict’ object is unsafe. }}
I just want to fetch that value who’s opened last time
@ankush
ankush
6
That’s because it’s not allowed to access attribute starting with underscore in server scripts, maybe select it with different alias _seen as seen_by
?
ok, let me check.
I’ll confirm you
@ankush