Here is the Code that you can get List of
Printer using X++. To Create Job and Run the Job and Infolog will Show you
Printers List.
staticvoidShowListOfPrinters(Args _args)
{
printJobSettingsprintJobSettings;
mapprinterMap;
mapIteratormapIterator;
;
printJobSettings =
SysPrintOptions::newPrintJobSettingsOnServer();
sysPrintOptions = newsysPrintOptions();
sysPrintOptions.setPrintJobSettings(printJobSettings);
sysPrintOptions.buildPrinterMap();
printerMap = sysPrintOptions.getPrinterMap();
mapIterator = newmapIterator(printerMap);
mapIterator.begin();
while (mapIterator.more())
{
info(mapIterator.value());
mapIterator.next();
}
}
Thanks for comments.....