Expand my Community achievements bar.

Multiple barcodes in a dynamic form don't work

Avatar

Former Community Member

Hi everybody

I have a form in which I can add new items using instanceManager. I want to capture the data from each item i separate barcodes, and here comes the problem. I can make the barcode capture data from the first item in the form, but when I add new items when I fill out the form, the barcodes all refers to item no. one.

How can I make each new barcode refer to the right item?

The objects for item information including the barcode is placed in a subform.

I hope someone can help.

K

P.S. If the question seems familiar, its because I have already posted it in another forum, but without any result. So I try again.

7 Replies

Avatar

Former Community Member

Here is an example that I got from Steve Walker (another person who posts onthis forum)  that I think does what you want.

Paul

Avatar

Former Community Member

Hi Paul.

It was something like that, and yet no quite. I want not just one barcode in the form, but a barcode for every single item.

The example in your post did, however solve another of my problems, with removing items from the form. I can make that part work now.

K

Avatar

Former Community Member

So you will put a barcode on each line in the table and you want the barcode to hold the data from the row? Here is an example ...it is not pretty but it gets the job done. The barcode will not update until you exit the quantity field.

Paul

Avatar

Former Community Member

That's basically what I want. But I can't see that the barcode is working properly. It doesn't update when I enter data to the items. (Not on leaving the quantity field either.) And when I open the form in LiveCycle I am met with an error message, telling me that the script returns a null value.Can you help me with that?

Kirstine

Avatar

Level 4

If you'd like, I could look at the form if you e-mail it to me (my e-mail is on my profile page).

Thanks,

Alex

Avatar

Former Community Member

I do not have a barcode scanner to validate that value that is in the barcode. I added a message after the call to update the barcode (on the exit of the quantity field) to display the value of the barcode in a message box and it seems to be working fine.

I did find an issue with teh PartNumber and modified that as well.

Have a look at this one and let me know.

Paul

Avatar

Former Community Member

Hi Paul

Your scrip didn't quite work. But it helped me in the right direction. Thanks a lot.

I made the script like this:

RIrekvUdv1.Prver.Effekt1.RIrekv_Prv_1::calculate - (JavaScript, client)

//{{Start Generated Content//

var

is705ViewerRequired = false;

//End Generated Content}}//

function

encodeBarcode() {

var str = AntmskStd.rawValue + "\n"

+ xfa.resolveNode("Effekt1[" + this.parent.index + "].Prvetyp").rawValue + "\n"

+ xfa.resolveNode("Effekt1[" + this.parent.index + "].PrveAnt").rawValue + "\n";

return str;

}

function

getInstanceData(node) {

var str = "";

var nNodeLength = node.length;

for (nNodeCount=0; nNodeCount < nNodeLength; nNodeCount++) {

str

+= node.item(node).rawValue + "\n";

}

return str;

}

this.rawValue

= encodeBarcode();

//app.alert(this.rawValue);

Kirstine