I'm attempting to add some custom validation to a record type in NetSuite using SuiteScript 2.0.
On the client side, I've been able to use a client script to validate fields before submit. This works well and shows a user-friendly error message explaining what's wrong.
On the server side, using a user event script, I also perform the same validation. This catches violation from other sources (e.g. CSV upload) which don't use the client script. If a violation is found, the script throws an error using the error module (e.g. throw error.create({...}))
However, there are certain actions the user can perform (e.g. pressing void button on the record's view screen) which don't use the client script yet modify the record. If the user event script detects a violation, it ends up showing an error message (formatted in json) on a blank screen. Not the most user friendly.
At a minimum, is there a way to show a message on the blank screen that isn't formatted in JSON? Ideally, it would be nice to show the error message on the same screen as the button using the message.create/show module.