By using this website, you agree to our Terms of Use (click here)
I am writing a custom program to do just in time Pick List printing. The user will hit print and the program will create the shipment and print the oldest open orders up to x number of orders. I want to leave the orders open as long as possible to allow for easy changes if the customer calls back to add, change or delete items from the order, which happens frequently in my business.
I want to print the pick list report without showing the report in the report viewer. I don't want them to be able to back out from printing the report or emailing the report. I want the print button to just print with no steps in between.
Do any of you know if this is possible? If so, do you know the command I need to use to launch the rpx file directly?
Thank-you.
Interested in this as well.
Customer wants Production Tickets to automatically print upon Release of Production Orders.
Here are the steps I took to get it all working.
Device Hub
Once you have installed Device Hub make sure you enter the program by right clicking on the app and selecting Run as Administrator. It lets you setup the printer without that but it will not work. Once in the app enter the Device ID under the General tab, enter the Url and credentials on the Connection tab, and enter Name and Select your printer under the Printer tab.
Setup Printer in Acumatica: System Maintenance==>Printers (GI000100)
Use Update Printer List action, if your printer does not load with this action then it is not setup correctly in Device Hub. Manually entering the printer information is a waste of time, the printer will not show as active when manually entered.
Setup Restriction Groups for Printer Access: Configuration==>Printer Access (SM106000)
Setup Default Printer and or assign Printer to specific printer under the User’s Profile (SM203010)
Code:
[Serializable]
[PXCacheName("PrintPickTicketFilter")]
public class PrintPickTicketFilter : IBqlTable
{
#region UsrBranchID
[PXDBInt()]
[PXDefault(typeof(AccessInfo.branchID))]
public virtual Int32? UsrBranchID { get; set; }
public abstract class usrBranchID : PX.Data.BQL.BqlInt.Field<usrBranchID> { }
#endregion
#region PrintWithDeviceHub
[PXDBBool]
[PXDefault(typeof(FeatureInstalled<FeaturesSet.deviceHub>))]
[PXUIField(DisplayName = "Print with DeviceHub")]
public virtual bool? PrintWithDeviceHub { get; set; }
public abstract class printWithDeviceHub : PX.Data.BQL.BqlBool.Field<printWithDeviceHub> { }
#endregion
#region DefinePrinterManually
[PXDBBool]
[PXDefault(true)]
[PXUIField(DisplayName = "Define Printer Manually")]
public virtual bool? DefinePrinterManually { get; set; }
public abstract class definePrinterManually : PX.Data.BQL.BqlBool.Field<definePrinterManually> { }
#endregion
#region PrinterID
[PXPrinterSelector]
public virtual Guid? PrinterID { get; set; }
public abstract class printerID : PX.Data.BQL.BqlGuid.Field<printerID> { }
#endregion
#region NumberOfCopies
[PXDBInt(MinValue = 1)]
[PXDefault(1)]
[PXFormula(typeof(Selector<SOShipmentFilter.printerID, PX.SM.SMPrinter.defaultNumberOfCopies>))]
[PXUIField(DisplayName = "Number of Copies", Visibility = PXUIVisibility.SelectorVisible)]
public virtual int? NumberOfCopies { get; set; }
public abstract class numberOfCopies : PX.Data.BQL.BqlInt.Field<numberOfCopies> { }
#endregion
}
public PXFilter<PrintPickTicketFilter> Filter;
#region Print Pick Ticket
public void PrintPickTicketWithDeviceHub(string shipNbr)
{
SOShipment ship = SOShipment.PK.Find(this, shipNbr);
if (ship != null)
{
if (Filter.Current.PrinterID == null)
{
var usrPrefs = UserPreferences.PK.Find(this, base.Accessinfo.UserID);
if (usrPrefs != null)
{
Filter.Current.PrinterID = usrPrefs.DefaultPrinterID;
}
}
var printSettings = new PrintSettings
{
PrintWithDeviceHub = Filter.Current.PrintWithDeviceHub,
DefinePrinterManually = Filter.Current.DefinePrinterManually,
PrinterID = Filter.Current.PrinterID,
NumberOfCopies = Filter.Current.NumberOfCopies
};
Dictionary<string, string> parametersDictionary = new Dictionary<string, string>();
parametersDictionary["Shipment Nbr"] = shipNbr;
Object cstmr = Customer.PK.Find(this, ship.CustomerID);
string actualReportID = new NotificationUtility(this).SearchReport(SONotificationSource.Customer, cstmr, SOReports.PrintPickList, Filter.Current.UsrBranchID);
PXReportRequiredException ex = null;
ex = PXReportRequiredException.CombineReport(ex, actualReportID, parametersDictionary);
SMPrintJobMaint.CreatePrintJobGroup(printSettings, ex, actualReportID);
}
}
#endregion