This example shows you how to edit a script using Script Editor, and create a prompt for user input. As well as automatically inserting text in Narrative lines, we want to prompt the user to key in additional text to include in the narrative line. We will re-use the script we created previously. Load the script named InvoicePropertyStatement.pfs created in Script to Add Narrative Lines to an Invoice.
Form1.Line.Description = .... to frmINInvoice1.Line.Description = "Consignment Note No.: " &
InputBox(, , ,)
This shows that the InputBox function has 4 possible arguments, separated by the 3 commas in brackets. See Online Help > MaxBasic functions > InputBox for more information about the arguments you need to enter for the InputBox function. You can access this from the drop down menus, select Functions > Input > InputBox > Help Inputbox
"Enter Consignment Note Number" before the first comma. "Consignment No." before the second comma.frmINInvoice1.Line.Description = "Consignment Note No.: " & InputBox("Enter Consignment Note Number", "Consignment No.")
Dim frmINInvoice1 as Object
frmINInvoice1 = GetActiveObject
If IsNull(frmINInvoice1) or frmINInvoice1.ClassName <> "INInvoiceEntryForm" then Error "Wrong form class for script"
frmINInvoice1.Edit
frmINInvoice1.Line.Append
frmINInvoice1.Line.LineType = "Narrative"
frmINInvoice1.Line.Description = "Consignment Note No: " & InputBox("Enter Consignment Note Number","Consignment No.")