Hello, I am having some issues with making a script to change the output setting for paperless office inside of sales order printing. I have some code below that I found searching the forum. The way it is now I do not get an error message and nothing happens. I am doing this under Custom Office > Customizer Selection > Sales order Printing >>> SO_SALESORDERPRINTING.M4L and writing the script as a Panel - PostLoad. I just want to change the output to "Electronically Deliver Only" Any help would be much appreciated.
SONo = ""
oSOPrint = ""
oPaperless = ""
retVal = oBusObj.GetValue("SalesOrderNo$", SONo)
Set oSOPrint = oSession.AsObject(oSession.GetObject("SO_SalesOrderPrinting_rpt"))
retVal = oSOPrint.SelectReportSetting("STANDARD")
oSOPrint.QuickPrint = SONo
'Set Paperless options
Set oPaperless = oSession.AsObject(oSOPrint.coPLCommon)
oPaperless.FormPrintUISelection="2"
retVal = oSOPrint.ProcessReport("PRINT")