I want to generate sales invoice automatically after the sales delivery validation. To achieve this I created the Server script as per attached screenshot. Server script is running without any errors but the sales Invoice is not getting generated.
Script Type : DocType Event
Reference Document Type: Delivery Note
DoctType Event: After Submit