Also can client scripts work on the addressbook su...
# suitescript
a
Also can client scripts work on the addressbook subrecord?
m
At a previous job, I developed an integration to an address validation API. Google Maps was not accurate enough so they ended up paying for an Australia specific API. It was fully client-side. You can't deploy scripts to address record, but you can set a client script on the form level
a
Thanks @michoel!
but you can set a client script on the form level
What do you mean by this? What's the form level? The customer?
m
message has been deleted
a
Ah. Thanks. I have never used that. So that has the same entry points as any client script, such as fieldChanged?
m
Yup
a
Thank you very much!
m
Also, beware in some cases NetSuite tried to run this "client" script server-side and caused issues due to the code using browser specific API's not supported by Rhino.
I had to add a check for
window
object to prevent that
a
Why did it try to run a client script, server side? 😕 Its a netsuite bug?
m
Seems like it's actually documented behavior
message has been deleted
a
Interesting. Not quite sure how that work? Like onSave would work like beforeSubmit? It would be nice if I have an option of using this server side because I would prefer a more reliable way of having this implemented
m
Sorry I don't recall details