How to query the lastmodifieddate of a transaction...
# ask-stanley-ai
a
How to query the lastmodifieddate of a transaction record, down to the millisecond? When I use search.lookupFields, it returns the date as text down to the minute. I want more granularity.
1
c
AI generated answer (using internal Slack threads):
In NetSuite, the
lastmodifieddate
field of a record is a datetime field, but when you use
search.lookupFields
or
record.getValue
, it returns the date as text down to the minute. If you want to get the
lastmodifieddate
down to the second, you can use a SQL function
to_char
in a SuiteQL query. Here is an example of how you can use it:
Copy code
sql
SELECT to_char({lastmodifieddate},'YYYY-MM-DD HH24:MI:SS') FROM transaction
This will return the
lastmodifieddate
in the format 'YYYY-MM-DD HHMMSS', which includes the seconds. Please note that this will only work in a SuiteQL query, not when using
search.lookupFields
or
record.getValue
. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839904785
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817077637
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81237793
Please provide your feedback on this answer.
a
you can use the fields created on and modified on.
a
Thank you for the advice, but I have not found any transaction fields with those names, or with scriptid createon or modifiedon. How do I locate them?
a
see
you can track till seconds as well like this
1
a
Thank you 🙂
a
welcome