I’m trying to create an Action button on Shipments screen that would automatically print the Packing Slip to a particular printer. I’ve the following code added to the SOShipmentEntry:
namespace PX.Objects.SO
{
public class SOShipmentEntry_Extension : PXGraphExtension<PX.Objects.SO.SOShipmentEntry>
{
#region Event Handlers
public PXAction<SOShipment> print;
[PXUIField(DisplayName = "Print Packing Slip with DeviceHub")]
[PXButton]
public virtual IEnumerable Print(PXAdapter adapter)
{
SOShipment shipment = Base.Document.Current;
Dictionary<string, string> parametersDictionary = new Dictionary<string, string>();
parametersDictionary["ShipmentNbr"] = shipment.ShipmentNbr;
PrintSettings printSettings = new PrintSettings()
{
PrinterID = "PACKINGSLIP1",
NumberOfCopies = 1,
PrintWithDeviceHub = true,
DefinePrinterManually = true
};
PXGraph.CreateInstance<SMPrintJobMaint>().CreatePrintJob(printSettings,"SO642000",parametersDictionary,"Packing Slip");
return adapter.Get();
}
#endregion
}
}
I get the following errors when I validate the code:

I can bypass the first error “Cannot implicitly convert type string to System.Guid?” by specifying printerID as the default printer set up on the user profile, but that doesn’t get rid of the second error where it says “No overload for method ‘CreatePrintJob’ takes 4 arguments”.
I’ll appreciate any help!