Another issue is I am using the N/query to get the...
# suitescript
s
Another issue is I am using the N/query to get the country idea, but under a certain role I am getting the error
SSS_SEARCH_ERROR_OCCURRED Search error occurred: Record 'country' was not found.
I am in a client script, so I can't say "run as admin"
Copy code
const result = query
    .runSuiteQL({
        query: 'SELECT uniquekey from country where id = ?',
        params: [country]
    })
    .asMappedResults();
_countryId = result[0].uniquekey;
_country = country;
b
the usual guess is permission related
if you cant expand the permissions for the role, then make a suitelet that does the query instead
s
Any idea what permission it would be that would grant this?
b
use a role with administrator permission to find the url to a country
then navigate to the url with your problem role
s
How does that work? How do you find the url to a country
b
the ui tends to give nicer error messages
s
😕 struggling to understand.
I'm not sure about the url for the url to a country
b
honestly either works, but the general idea is that the ui has a mechanism to detect permission violations
s
Which would you recommend? From the client, all it says is the same error
b
and sends you back to the role selector with an error message stating the permission you are missing
b
thats not a country related url
s
It's the url in the network tab that triggered when it called and received the error
b
find the url for something country related
start in the administrator role
s
k, this is in admin mode and this is the call to get the country
message has been deleted
b
still not a country related url
its not a suitescript related technique
s
how would I find a coultry related url?
i mean there is setup company --> countries
but that is setup/states
b
that path would get you to the list view of the countries
s
That's not a permission I can give someone
b
get the url of the page that lists counties
and navigate to it while logged into the problem role
s
I am trying to find that, and I don't think that exists from teh UI
nvm. it is setup/countries
app/setup/countries.nl
b
copy the url and navigate to it while logged into your problem role
s
You are awesome.
So they would need the 'set up company' permission
a
Yep, and you don't want all users with Setup Company permissions, so back to square one, that would be a middle man Suitelet.
v
Countries are not a record in NetSuite, as far as I can tell. It is a list, and even then I can't query it. I use a hard-coded list if I need details.