and a relatively minor one: when creating a new r...
# suitescript
k
and a relatively minor one: when creating a new record, the
.save()
method returns the record's id, but i observe that the record (which you called .save on) does not have its
.id
property updated. i take this to mean that none of that record's data reflects the reality of what was stored necessarily, only what you fed "in" to the system. with that said, is it possible to get the create/modified timestamps for a record after saving it without loading it? (one might expect that after a successful save, this information is known - but the api doesn't seem to communicate it back) i could just use
new Date()
but it won't be precisely accurate, however the load times i'm experiencing seem pretty bad and i don't really want the extra api latency if i can help it
e
The changes timestamps are stored in the system notes table, not the modified record itself.
The record is updated, but we don't have a
last-modifed-at
field in the record.
k
Customer, Customer Deposit, and Sales order at least seem to expose
dateCreated
and
lastModifiedDate
?
should i use something other than lastModifiedDate?
e
What SuiteScript module are you using?
search
,
sql
?
k
search
i was deep in it before i realized sql existed - is sql more modern / more performant? i'd probably strongly prefer to write sql if i could 😅 however, i wouldn't be surprised if it's a translation layer rather than a more direct way to query data
(i suppose it doesn't matter how i'm searching, since in this instance i'm talking about N/record and whether i can get "the dates as recorded by netsuite" when saving a record without loading it again - the answer seems to be no)
new Date will suffice with the gotcha that it may be slightly inaccurate, so i'll have to ensure i don't care strongly about exact match