Please Help (Pdf Viewer)

Setting up to display pdf file into pdf viewer

I have followed this to the letter but I continue to get a script error, and I can’t figure out why, I have worked on this till I am blue in the face.

‘’’
# Check to see if the property that changed was the Selected Value property.

if event.propertyName = = "selectedValue" :

# Run the query to grab the file name and bytes using the new selected ID value.

system.db.runNamedQuery( "Read File" , { "fileID" :event.newValue})

# Grab the file bytes and name from the same row.

bytes = data.getValueAt( 0 , "filebyte" )(This is my error “data” is not defined!! )

name = data.getValueAt( 0 , "fileName" )

# Load the bytes into the PDF Viewer component.

event.source.parent.getComponent( 'PDF Viewer' ).loadPDFBytes(bytes, name)
‘’’

You need to store the results of the named query into the data object. So data = system.db.runNamedQuery( "Read File" , { "fileID" :event.newValue})

Thanks for the help, I finally got some of my other problems worked out also.

I was have several issues that was causing me to pull my hair out, once I got the “Firewall” issue figured out the rest of it started coming coming together.