I am trying to setup a button on documents to print to our label printer.
Using a revised version of clintm@cfh.ca's instructions (revised because our office uses Chrome not IE and his instructions use the activeX commands) I created a button on the required transactions. This button works fine however these custom buttons only appear when in edit mode and it would be preferable to have them in view as well.
So I created a workflow that adds a button, when the button is clicked it moves the workflow to the next state where the custom action is executed on entry (this executes the same function, script and library script as the custom button) before returning to the initial state (after submit or blank).
However when the button is clicked a page loads with the netsuite message "Error: Your browser does not support loading xml documents"
This is the main javascript, based on help on the dymo website
function xSingleLabel() { var labelXml = ' <DieCutLabel Version="8.0" Units="twips"> <PaperOrientation>Landscape</PaperOrientation> <Id>Address</Id> <PaperName>30252 Address</PaperName> <DrawCommands/> <ObjectInfo> <TextObject> <Name>Text</Name> <ForeColor Alpha="255" Red="0" Green="0" Blue="0" /> <BackColor Alpha="0" Red="255" Green="255" Blue="255" /> <LinkedObjectName></LinkedObjectName> <Rotation>Rotation0</Rotation> <IsMirrored>False</IsMirrored> <IsVariable>True</IsVariable> <HorizontalAlignment>Left</HorizontalAlignment> <VerticalAlignment>Middle</VerticalAlignment> <TextFitMode>ShrinkToFit</TextFitMode> <UseFullFontHeight>True</UseFullFontHeight> <Verticalized>False</Verticalized> <StyledText/> </TextObject> <Bounds X="332" Y="150" Width="4455" Height="1260" /> </ObjectInfo> </DieCutLabel>'; var label = dymo.label.framework.openLabelXml(labelXml); var Address = nlapiGetFieldValue('shipaddress'); label.setObjectText("Text", Address); var printers = dymo.label.framework.getPrinters(); if (printers.length == 0) throw "No DYMO printers are installed. Install DYMO printers."; var printerName = ""; for (var i = 0; i < printers.length; ++i) { var printer = printers[i]; if (printer.printerType == "LabelWriterPrinter") { printerName = printer.name; break; } } label.print(printerName); }The second referenced file is this file hosted on our netsuite account to get round certificate errors.My coding knowledge if fairly limited and I do not understand why the same javascript files work for one button and not for another, and is there a way to solve this?