anyone know how to get around data restrictions in...
# suitescript
n
anyone know how to get around data restrictions in a client script? trying to fetch tax data for any role but its causing issues for certain custom roles
a
off the top of my head. use a suitelet that runs as admin call it from the CS and return the data as JSON
n
interesting
that could def work
a
oh it works 🙂 there might be a performance concern depending on the amount of data, and if you need to keep recalling it though.
😂 1
n
yeah i mean we just want to fetch the tax codes
so this should probably be OK
👍 1
n
Be wary of that, setting the SuiteLet to run as admin is no guarantee it will run as admin if it's called from a client script.
🙏 1
a
... wait, what?
n
Had exactly that recently. SuiteLet set to Run as Admin. Button added via UE script. User presses button, client script calls SuiteLet, access issues. Logged out the role in the SuiteLet and it had the user's role not admin role. Same when I shifted the functionality to a UE. Now I should say there is a workflow that locks the record if the role is not admin and maybe it's clever enough to ascertain the logged on user and take that as gospel and not directly an issue with running the script as admin... but beware!
👍 2
👀 1
a
huh interesting, thanks for sharing, something to keep in mind for sure.
👍🏻 1