Expand my Community achievements bar.

how to get a barcode rawvalue

Avatar

Former Community Member
hi,



i have a form that has a barcode on the master page. the idea is to have a barcode on each page with the document number, the document version, and the page number.



I´m able to do this for the barcode. no problem here.



But, i was asked to put a textfield below the barcode with the barcode rawvalue. is it possible ?



i was trying to use the below embedded feature of the barcode. it works, but the numbers are being cutted in half.



Any idea on solving this issue ? (how to let the barcode show the entire numbers without cutting them)



How to get the rawvalue of the barcode into a textfield ?



thanks,
3 Replies

Avatar

Former Community Member
Hi Rui,



This is very easy. The barcode is treated just like any other object on your form. You can retrieve the value of the data in the barcode by using the ".rawValue" property.



MyTextField.rawValue = myBarcode.rawValue;



One thing you need to watch out for though, is when you use the Automated Script make sure that the text object you created is not included in the Barcode. If do you this by mistake the barcode will try to include data from the text field which creates a kind of recursion.



In regards to the "entire numbers" can you post and example of what you see in the text field?

Avatar

Former Community Member
hi Lee,



I couldn't access the barcode raw value. I have the barcode on my master page and i wanted the textfield on every page.

The idea was to have the barcode with some data (document number and document version ) and then put that data on evey page using the texfield ( one for each page ).



What i did in order to solve it was going to the barcode OBJECT tab ... and then to the FIELD tab ... on location i had selected the "embedded below" option. that was causing the numbers below the barcode to be cutted in half (in height). they were not appearing "entirely".



I just changed that property from "embedded below" to "below" ... that way i don´t need to use the texfield to put the content of the barcode. the barcode itself has that property. I didn´t know that. That was the reason that was making me have that texfield. therefore, i don´t need to go get the rawvalue anymore.



but i´m still curious. If the barcode is on the master page like mine, is it possible to get the rawvalue like you mentioned before ??



thanks for your help,

regards,

Avatar

Former Community Member
Hi Rui,



If you want to access the value of an object that is not on the current page then you need to specify the full path for the object (resolve the node).



The easiest way to find out what this is, is to check the hierarchy of the document, or when you are inside the Script area where you want to access the object, simply hold down the control-key and click on the barcode object (or any other object for that matter) then add the ".rawValue" to the end. This will give you something like:

xfa.resolveNode("form1.#subform[0].Name").rawValue;



Also, to make your life easier (and the code more readable) make sure you name your pages and subforms.



You can also type the full path of the object and as you type you will be shown the available objects / properties automatically by Designer:

xfa.form.form1.page1.subformX.myBarcode.rawValue;