So here's a weird one... Two employees have the sa...
# suiteql
m
So here's a weird one... Two employees have the same roles and permissions within NetSuite. A Suitelet executes a SuiteQL query as administrator. For one employee, the suitelet works perfectly. For the other, the query returns a bunch of nulls in lieu of several (but not all) of the fields. There's nothing in the suitelet that does anything with permissions. In theory, really, it should work for everyone all the time. I'm... mystified by this behavior. 🤔 Any clues?
n
How odd. Did you double check the employee record to make sure there were no individual permissions assigned to one?
Saying that though, executing as admin should ignore all that
m
While poking at it and getting more coworkers to run the suitelet, I have a potential suspect: timezones. I noticed that a date filter is being applied to a join within the query. I have a suspicion that maybe, somehow, the calculated date ends up being different for somebody a couple timezones away.
n
Damn.. timezones always ruining everything
m
The odd thing is that hours are never involved - it's just year-month. All the datapoints I'm looking for are always on the first of a month. I'll add debug traces tomorrow and get my coworker on the west coast to run the suitelet again, see if that brings anything to the surface.
n
How weird. Im curious to hear what you find out.
a
Check the User's Role and see if they are Restricting any Permissions.
a
yeah subsidiary restrictions could be a culprit here potentially
m
I confirm that timezones were the issue! Specifically, I learned the hard way that a date written in
yyyy-MM-dd
format is interpreted in UTC, whereas the format
yyyy/MM/dd
is interpreted... in local time. ...This led to stuff, as all you fine readers can imagine. I put everything onto the same format and now the code's behaving as it should, working for everybody no matter which coast they're on.
🫡 1
👍 1