Is it possible to set a custom field mandatory aft...
# suitescript
f
Is it possible to set a custom field mandatory after using the close Button on the SO ? We want our sales team to justify the reason why closing the SO.
a
making something conditionally mandatory seems more complicated than what you actually need, I think the easier approach is to just check if the field is empty and return msg to the user that they can't close without giving a reason
👍 1
I'm not sure if you can intercept the close button click event specifically client side? you might have to remove the native button, and create your own custom close button to add that functionality, that seems vaguely familiar to me but I haven't done anything like this in a LOOONG time 🙂
👍 1
e
^ Spot on. The native Close button is only present in VIEW mode, and none of the native Client Script entry points fire in VIEW mode. To do this, you'd have to make a User Event which attached a Client Script in VIEW mode, and then the Client Script would have to hijack the Close button click using DOM methods, which are not officially supported - or make your own Close button as Anthony suggested.
☝️ 2
f
Got it thanks so much. I would therefore go the return msg route. Thanks