Hi everyone, I'm trying to prevent a vendor bill f...
# general
a
Hi everyone, I'm trying to prevent a vendor bill from being saved when the same vendor has a field value X registered in another previous invoice (The key would be (vendor + X value). I'm doing this through a userEvent in the beforeSubmit, however, I see that even though it reaches the condition, it doesn't prevent it from being saved and it continues to be saved, nor does it show me the alert message. I know it reaches the condition because it shows me a previous log message that I put. Thank you.
r
if you are creating vendor bill through UI only, then client script saveRecord entry point will be best for your use case. But if the vendor bills are getting created through server side as well, then you need throw an error. Just returning false will not stop the record from being saved. You can't use Netsuite alerts in userEvent, that's something you need to do on client side. Although there are ways around it by using combining befloreLoad with pageInIt.