We have a custom record type in our system (no sys...
# suitescript
d
We have a custom record type in our system (no system notes), which is used for warehouse despatch processes. When an order ships, a user updates the record, the lastmodified date/time changes and lastmodifiedby is set to the user who made the change. A scheduled script later changes a couple of fields. When this happens, the lastmodified time changes, but the lastmodifiedby stays at the previous user, rather than showing system, or the script owner. Is this normal, or can the behaviour be changed in some way? Ideally, I'd stop lastmodified being changed by the scheduled script, but I suspect that wouldn't be feasible.
p
May I ask why you don’t just enable system notes?
d
Performance/data usage. We purge the records after a period of time, but currently have 2m+ records.
p
To my knowledge there is no way to change this behaviour
but maybe someone else has a good idea 🙂
s
You could probably add your own custom last modified and modified by fields, and use default values, or a simple workflow or script to set them upon record submit/save.
Kind of duplicating what already exists, but you get to maintain a little more control of those fields for whatever auditing purposes you need
d
I'll probably add in a new date field to store the user change time, but with the scale of the records want to avoid changes wherever possible to minimise performance issues. I can pick up lastmodified and store in a custom field before the record change.
I just find it a bit odd that the scheduled process changes the lastmodified date, but doesn't get logged in the modifiedby field. Really asking in case this is a defect?
s
Only NetSuite really knows, but they’ll probably respond that it “is working as designed”
p
if you really are trying to squeeze the amount of data to a minimum maybe all you need is a checkbox “Last edited by Script” and then have a field without storing that shows either the user or system depending on the checkbox instead of the standard field. doesn’t stop people from running searches on “last modified by” though. Use a UserEvent or Workflow to check/unch the box based on change context before save
b
Im guessing that your scheduled script is being started by N/task, in which case netsuite uses the user of the task submitter as the user
Instead let the scheduled script run on a schedule, where the user is system