Forum Discussion

DrewVoge's avatar
DrewVoge
Qrew Cadet
11 years ago

Script a button to print current record to DYMO

I'm finally moving a product pricing process from EXCEL into QB.

The last step is giving a user(s) the ability to print product labels from QB to a local DYMO printer.

What I had envisioned was a button on the record form that would take a half dozen or so values in the record and push them as values for the label.

Has anyone here done this already? If so, are you willing to share any of your scripting?

My JavaScript experience is extremely limited. This link is an example of printing to a DYMO via a JavaScript library, but I don't really understand how to set the values of QB fields as the values to send to the printer.

http://developers.dymo.com/2010/06/02/dymo-label-framework-javascript-library-samples-print-a-label/

Any help would be greatly appreciated.

  • I tied creating an example based on that documentation page but ran into a problem. The statement that defines labelXml isn't valid JavaScript and I get an error on this statement"

    label.setObjectText("Text", textTextArea.value);

    I am sure it is an easy fix but not without further investigation. Their docs are not too good. Contact me offline if you want the code I wrote.
  • Dan was able to provide the 'click to print' capability I was looking for via some scripting.  Works like a charm.  Would recommend if you are looking to print directly to a DYMO label printer.
  • It turned out to be an easy fix but there is always some learning curve when dealing with a new API. What I wound up doing is adding a button to the view page that ripped the text to send to the label printer. Specifically, a formula field was created named [label] that built up the address from [name], [address], [city], [state] and [zipcode] fields and then I ripped the assembled text out of the table cell <td> with the following jQuery:

    var labelContents = $("#tdf_5").html();

    Also, you have to host the Dymo JavaScript library out of a QuickBase user defined page because Dymo does not offer https.