Is a non-admin able to query systemnotes? or searc...
# suitescript
m
Is a non-admin able to query systemnotes? or search? I’ve confirmed logging in as the role allows me to see the system notes through the UI (added the notes tab permission) but am returning 0 results when either trying to search for it or query it.
j
does the role have both view on the record and Notes Tab permission?
s
You should be able to see it as non admin. it depend on the permissions. As I recall they need search permissions and view permissions for the record
m
hmm, here’s what I’ve got, Then I log in as the role and try to run the following scripts and get nada:
Copy code
require(['N/query', 'N/search']);
const query = require('N/query')
const search = require('N/search')
var creator = search.create({
                type: "systemnote",
                filters:
                [
                   ["recordid","equalto",240743], 
                   "AND", 
                   ["type","is","T"]
                ],
                columns:
                [
                   "name",
                ]
             }).run().getRange(0,1)[0].getValue("name")

const queryString = `SELECT TOP 1 name FROM systemnote WHERE recordid=240743 and type=1`;
            log.debug("creatorQueryString", queryString);
            const creatorSQL = query.runSuiteQL({
                query: queryString,
            });
b