I'm stumped: My Suitelet has the same audience, th...
# suitescript
a
I'm stumped: My Suitelet has the same audience, the same Run As Role, etc. as another Suitelet whose External URL works perfectly, but clicking my suitelet's External URL goes to a You do not have permissions screen before it has a chance to call the entry point function onRequest (confirmed by placing a log.debug at the beginning). Internal URL works fine, but external doesn't even if I Run AS Role = Administrator, so I know it's not a permissions issue.
1
m
Did you set the online form user in the external roles of the audience tab
a
Let me check...
Where would I find Online Form User? I looked through one of the external Roles and didn't find anything named that. Is it a permission? Also, why does that matter how the other roles are set, if my Run As Role is Administrator (not going to keep it there, on an external URL suitelet, of course; This is just to get me past this strange error). Also the working script's deployment has all the exact same Audience settings (internal and external roles, it includes all of both). In other words, if the Roles' settings matter, then why does it work for one script but not the other, with the same roles?
Ah okay I see, in the help file, it's a role: To ensure that users without an active NetSuite session can access the Suitelet, Online Form User must be selected in the External Roles field. All other roles that require access to the script should also be selected in the Internal Roles and External Roles fields. Values from the Departments, Groups, Employees, and Partners fields must be cleared. However that role doesn't show in the external roles multiselect, so it maybe inactivated... I'll check.
Hm. I don't see that role in our account even with Inactives shown, and if I download the XML for both Script definitions (the working suitelet and the one that's saying I don't have permissions), their audslctrole contains identical strings.
a
i'm guessing the oringal suitelet predates the existence of external roles being on the script deployment... and so it works anyway since NS didn't want to make breaking changes when they introduced that in... 24.2? i think?
1
there's a feature you have to turn on to make the online form user role available
a
OK that makes sense. I'll check the features.
Enabled Online Forms -- the Online Forms User role is now available. I set the audience to only that user -- now it works! Thank you. My subconscious was trying to tell me it was something like that but I think I let the AI shout over the top of it and missed out on my intuition. Thank you for pointing me in the right direction!
a
awesome 👍
🙌🏻 1