In the purchase order sample, there is code in the dropdown (txtPartNum) within the change event which calls the following
partNoScript.getDesc(xfa.event.newText, txtDescription, numUnitPrice);
The first parameter is the new value selected by the user in the dropdown, so in your example it would be 27001. The next two parameters are actual objects of the fields to fill. Since the reside on the same level within the subform they are just called txtDescription and numUnitPrice
Once the partNoScript.getDesc is called in the (variables) section, it will loop through the arrays looking for the part number and extracting the description and unit price and assigning them into the passed in objects.
I'm sure there is some limitation to the number of lines you can have but I tried quite alot and didnt have any issues (10000x50 characters), except for the scroll bar. In large lists the scroll bar doesnt go to the very last entry, but if you click the down arrow again, they appear. Probably a bug with the scroll bar.
Thanks for your help. I still cannot figure out what the problem is. I attached the code I am using so you might take a look at it. The one i have has 111998 characters. Or maybe you can give the one you prepared with the ( 100000x50 characters). Another thing dont worry about the drop down list. I changed that part of the document to a text field so the user will input the code manually.
"Multiform "R" Safety HairPin",
these are invalid js syntax. which causes the entire script block to be corrupt and the function cannot be found
Note for nested quotes ( " ) use
"Multiform \"R\" Safety HairPin",
after those are fixed your code works correctly. Use the check syntax button to highlight js issues.
Thanks for the help man. I dont know how come I missed the " marks. It works perfectly now.