I'm working with a SuiteCommerce Advanced 2019.2 website. I need to set a custom field when a quote is created using the Create a Quote feature. What's the best way to do this? Do I need to make a new SuiteScript model to extend the Quote.Model or is there a better way to handle it?
I tried wrapping the submit function for Quote.Model but that didn't work. I could also overwrite the whole submit function but I only need to set this one field.
Yes, you should wrap the model. In this case the "preSubmitRecord" function, which is inherited from the Transaction Model, should work fine.
To wrap the function, you can use the "Application.on" listener. You must also require "Application" on the definition of your file.