Is there a way to add a button to the Address moda...
# suitescript
m
Is there a way to add a button to the Address modal that pops up when you add or edit an address on a customer record? We're in the early stages of researching integrating address validation into NetSuite. Management doesn't want to use one of the existing packages like Pitney-Bowes or Addrexx and would like us to use the same service our other applications use (Mapbox) for address validation. There are a lot of steps here obviously, but the first one is getting a validate address button there like PB has that I can listen for clicks on.
m
If you Script this in 2.0 you could add the message with N/ui/message so that it appears the same as the save confirmation
👍 1
m
We do. So there's an event I can listen for there?
s
@mmoen We just installed PB, and I can say that what their button does is simply to open a popup using
window.showModalDialog
, or, if they detect it's running in Chrome,
window.open
. It actually doesn't work at all with Firefox so we have an open case with them. You are probably better off writing your own. I wish we had made that decision.
m
Yikes. That sounds pretty bad. We're definitely doing our own. Writing something to do the batch cleanups is straightforward, it's just figuring out how to trigger it on entry that's more tricky.
r
As far as I know, you can only attach form-level client side scripts to the address popup. You can probably add a pageInit function that creates the button for you.
👍 1
m
Okay, I'll start messing around there. I appreciate the tip.
m
I've written my own address validation. I use a custom field for the actual address input and disable the other fields, and then client script copies the validated address into the native fields.
If you remind me in about 3 hours when I get in to the office I'm happy to share my work with you.