Printing out barcodes?

Benjamin Nuttin
Giga Expert

We would like the ability to print out asset receiving forms to send to our vendors. These forms would have data from the system, mostly in the form of text fields and the like, but they would also have barcodes. These would simply be a representation of the asset serial numbers in a special "barcode" typeface. Has anyone done this before? Any idea how we can implement this? Thanks!!

1 ACCEPTED SOLUTION

That's pretty cool! It worked well for me. I put the code39.js code in a UI Script named "code39" and then included it on a UI Page with the HTML:



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:include_script src="code39.jsdbx"/>
<div id="externalbox" style="width:5in">
<div id="my_barcode" />
</div>
</j:jelly>


And then UI Page's Client Script is:



$("my_barcode").innerHTML=DrawCode39Barcode("123456789",1);


View solution in original post

22 REPLIES 22

do you know how i can display all assets on the hardware table? populate them with barcodes and asset tag #?




thanks


Hello Eirc,

 

I have tried same steps to generate barcode but I am getting error "DrawCode39Barcode is not defined" in console log.

 

Steps followed : 

1) Created a UI Script : code39 and pasted code39.js in it

2) Wrote below code in UI page in HTML : 

<g:include_script src="code39.jsdbx"/>
<div id="my_barcode" />

3) Included below code in same UI page's client script :

$("my_barcode").innerHTML=DrawCode39Barcode("123456789",1);

 

Please help.

How can i create Barcode Generate Button  in cmdb_ci_computer table  record.

how can i achieve it .please help me out.

Table: cmdb_ci_computer     ui name: generate_bar_code      name: Generate Barcode

script:

function barcode(){

var barcodeID = g_form.getUniqueValue();

var tableName = g_form.getTableName();
var recID = g_form.getValue('serial_number');
var recIDD = g_form.getValue('model_id');
var recIDs =g_form.getValue('asset_tag');

var numPrint = 1;

var instantPrint = true;

var dialog = new GlideDialogWindow('barcode_generator_home');
dialog.setTitle('');
dialog.setPreference("barcode_id", barcodeID);
dialog.setPreference("rec_table", tableName);
dialog.setPreference("rec_id", recID);
dialog.setPreference("rec_idd", recIDD);
dialog.setPreference("rec_ids", recIDs);
dialog.setPreference("num_print", numPrint);
dialog.setPreference("instant_print", instantPrint);
dialog.render();
}

 

 

bassed on 6 field values.

 

I know this is old and has been answered, but in case anyone ends up back here looking for info on barcode creation I wanted to update this to point to the Barcode Label Generator available on Share. The Barcode Label Generator installs as a plugin and creates barcodes for display or print in a number of formats. Check it out here:ServiceNow Share



Thanks to Ben Hollifield for providing this awesome plugin!


Chris York
Tera Expert

Thanks Eric! This is very timely. I just had a requirement to be able to print out barcodes. I set this up in a few minutes and it works perfectly.

Have you ever seen any integrations that use barcode scanners to read barcodes and input into Service-now? I'm thinking like a receiving type of situation where someone in a receiving area would get something delivered and scan it in to record it in Service-now.