I created a client script that prompts the user with an alert when a custom field that I created within the sales order is checked/true. Everything is fine if the logic of the script isn't triggered based on the custom field. But when the custom field is checked the alert displays as expected, but then after editing the sales order and unchecking the box I can't save the record. I can't save it even if I reload the page and try again, or even if I deactivate the script and reload the page and try to save it. The only way for me to actually be able to save the sales order after this has happened is for me to go into my browser and clear the cache, then I can save the record again. What I mean by I can't save the record is that when I click on save nothing happens, it just sits on that page. Below is my script.
/** *@NApiVersion 2.0 *@NScriptType ClientScript */ define(['N/ui/dialog'], function(dialog) { function verifyPrice(context) { var currentRecord = context.currentRecord; // var fieldName = 'custbody_verify_price'; if(currentRecord.getValue('custbody_verify_price') == true){ var options = { title: 'VERIFICATION NEEDED', message: 'Prices don't match' }; try { dialog.alert(options); log.debug ({ title: 'Success', details: currentRecord.getValue('transid') }); } catch (e) { log.error ({ title: e.name, details: e.message }); } } } return { saveRecord: verifyPrice }; });