public virtual void SOProcessFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { SOProcessFilter filter = e.Row as SOProcessFilter; if (filter != null && !String.IsNullOrEmpty(filter.Action)) { Dictionary <string, object> parameters = Filter.Cache.ToDictionary(filter); Records.SetProcessTarget(null, null, null, filter.Action, parameters); PXUIFieldAttribute.SetVisible <SOProcessFilter.printerID>(sender, filter, PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() && (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Records, filter.Action) == SOReports.PrintSalesOrder)); bool showPrintSettings = IsPrintingAllowed(filter); PXUIFieldAttribute.SetVisible <SOProcessFilter.printWithDeviceHub>(sender, filter, showPrintSettings); PXUIFieldAttribute.SetVisible <SOProcessFilter.definePrinterManually>(sender, filter, showPrintSettings); PXUIFieldAttribute.SetVisible <SOProcessFilter.printerID>(sender, filter, showPrintSettings); PXUIFieldAttribute.SetVisible <SOProcessFilter.numberOfCopies>(sender, filter, showPrintSettings); PXUIFieldAttribute.SetEnabled <SOProcessFilter.definePrinterManually>(sender, filter, filter.PrintWithDeviceHub == true); PXUIFieldAttribute.SetEnabled <SOProcessFilter.numberOfCopies>(sender, filter, filter.PrintWithDeviceHub == true); PXUIFieldAttribute.SetEnabled <SOProcessFilter.printerID>(sender, filter, filter.PrintWithDeviceHub == true && filter.DefinePrinterManually == true); if (filter.PrintWithDeviceHub != true || filter.DefinePrinterManually != true) { filter.PrinterID = null; } } }
public virtual void SOProcessFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { SOProcessFilter filter = e.Row as SOProcessFilter; if (filter != null && !String.IsNullOrEmpty(filter.Action)) { Records.SetProcessTarget(null, null, null, filter.Action); } }
public virtual void SOProcessFilter_PrinterName_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { SOProcessFilter row = (SOProcessFilter)e.Row; if (row != null) { if (!IsPrintingAllowed(row)) { e.NewValue = null; } } }
public virtual bool IsPrintingAllowed(SOProcessFilter filter) { return(PXAccess.FeatureInstalled <FeaturesSet.deviceHub>() && (filter != null && !String.IsNullOrEmpty(filter.Action) && SOReports.GetReportIDByName(Records, filter.Action) == SOReports.PrintSalesOrder)); }