Navigator > Setup > Company > Scripts > Script Events
You can set defaults for batch selection forms using an OnOpen script event.
This is useful for batch email forms, where you may want to set default values on the forms.
For example, you can set email defaults on the IN Email Invoices form. The following sample code could be used in an INEmailInvoiceReport.OnOpen event to set field defaults:
Dim EmailInvoiceForm as Object
EmailInvoiceForm = GetTriggerObject
EmailInvoiceForm.CustomerFrom = "ASHENG"
EmailInvoiceForm.CustomerTo = "ASHENG"
EmailInvoiceForm.CC = "CC Test"
EmailInvoiceForm.BCC = "BCC Test"
EmailInvoiceForm.ReplyTo = "Reply To Test"
EmailInvoiceForm.From = "From Test"
EmailInvoiceForm.EmailSubject = "Subject Test"
EmailInvoiceForm.EmailFileName = "Email File Name Test"
This allows you to set defaults for fields including the Customer selection, CC, BCC, ReplyTo, From address, Subject and Attachment.
Note that if you are using an email template, values set in the OnOpen script will override the template values.