Script a button to print current record to DYMO

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered

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.

Photo of Drew

Drew

  • 522 Points 500 badge 2x thumb

Posted 5 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
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.
Photo of TIm

TIm

  • 90 Points 75 badge 2x thumb
Could I get the code you wrote?
Photo of Drew

Drew

  • 522 Points 500 badge 2x thumb
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.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
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.
Photo of Shankar Ravi

Shankar Ravi

  • 280 Points 250 badge 2x thumb
Hi,

Can you give some reference for this?

Regards